import { h, Host } from "@stencil/core";
import { LoadingClass, LoadingSizes } from "./constants";
import { govHost, prepareClasses } from "../../../helpers/Dom/template";
import { validateProp } from "../../../helpers/Validate/props";
export class GovLoading {
    constructor() {
        /**
         * Loading size
         */
        this.size = 'm';
        this.h = govHost(this.host);
    }
    validateSize(newValue) {
        validateProp(LoadingSizes, newValue, LoadingClass.root);
    }
    componentWillLoad() {
        this.validateSize(this.size);
    }
    render() {
        return (h(Host, { key: '633a5908dcace7298026f28a9cd7e8cf7580ae3e', class: this.h.classes(LoadingClass.root), size: this.size }, h("div", { key: '39027a3ed4b2284070fe7f6954ec3864222b57aa', class: LoadingClass.content }, h("gov-icon", { key: '6baa68d8626e7b271eec0c6990b5999849a23fd5', class: prepareClasses([LoadingClass.icon, "gov-spin-animation"]), name: "loader", type: "components" }), h("slot", { key: 'c9179dc3e6de4cb6ce2da35b9b81dc16fc2fda67' })), h("gov-backdrop", { key: 'ca4fe88eb06122df18b717d008b7520724efd64e', inverse: true })));
    }
    static get is() { return "gov-loading"; }
    static get properties() {
        return {
            "size": {
                "type": "string",
                "attribute": "size",
                "mutable": false,
                "complexType": {
                    "original": "LoadingSizesType",
                    "resolved": "\"l\" | \"m\" | \"s\"",
                    "references": {
                        "LoadingSizesType": {
                            "location": "import",
                            "path": "./constants",
                            "id": "../../../packages/core/src/components/gov-loading/loading/constants.ts::LoadingSizesType"
                        }
                    }
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Loading size"
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "defaultValue": "'m'"
            }
        };
    }
    static get elementRef() { return "host"; }
    static get watchers() {
        return [{
                "propName": "size",
                "methodName": "validateSize"
            }];
    }
}
//# sourceMappingURL=gov-loading.js.map
