import { h, Host } from "@stencil/core";
import { FormLabelClass } from "./constants";
export class GovFormLabel {
    constructor() {
        /**
         * Label's size.
         */
        this.size = 'm';
        /**
         * Set whether the input is required or not.
         */
        this.required = false;
        /**
         * Use label as a legend for better accessibility.
         * Note: Don't forget to set the fieldset attribute of the gov-form-control component
         */
        this.legend = false;
    }
    render() {
        const Tag = this.legend ? 'legend' : 'label';
        return (h(Host, { key: 'ed4ec902f11631d324119863462a67305d8586e5', class: FormLabelClass.root, size: this.size }, h(Tag, { key: '04168b854261d7aca3c96ee0bd77ab8c2fc9d5f2', class: FormLabelClass.label, htmlFor: this.identifier, onClick: () => this.govClick.emit() }, h("slot", { key: '3d9fadd9d60baae633a699db046ca46605c4ab4c' }), this.required ? h("span", { class: "gov-color--text-status-error" }, "\u00A0*") : null)));
    }
    static get is() { return "gov-form-label"; }
    static get properties() {
        return {
            "identifier": {
                "type": "string",
                "attribute": "identifier",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Identifier for label."
                },
                "getter": false,
                "setter": false,
                "reflect": false
            },
            "size": {
                "type": "string",
                "attribute": "size",
                "mutable": false,
                "complexType": {
                    "original": "FormLabelSizesTypes",
                    "resolved": "\"l\" | \"m\" | \"s\" | \"xl\" | \"xs\"",
                    "references": {
                        "FormLabelSizesTypes": {
                            "location": "import",
                            "path": "./constants",
                            "id": "../../../packages/core/src/components/gov-form/label/constants.ts::FormLabelSizesTypes"
                        }
                    }
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Label's size."
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "defaultValue": "'m'"
            },
            "required": {
                "type": "boolean",
                "attribute": "required",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Set whether the input is required or not."
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "defaultValue": "false"
            },
            "legend": {
                "type": "boolean",
                "attribute": "legend",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Use label as a legend for better accessibility.\r\nNote: Don't forget to set the fieldset attribute of the gov-form-control component"
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "defaultValue": "false"
            }
        };
    }
    static get events() {
        return [{
                "method": "govClick",
                "name": "gov-click",
                "bubbles": true,
                "cancelable": true,
                "composed": true,
                "docs": {
                    "tags": [],
                    "text": "Emitted when the label click."
                },
                "complexType": {
                    "original": "PointerEvent",
                    "resolved": "PointerEvent",
                    "references": {
                        "PointerEvent": {
                            "location": "global",
                            "id": "global::PointerEvent"
                        }
                    }
                }
            }];
    }
}
//# sourceMappingURL=gov-form-label.js.map
