import { h } from "@stencil/core";
import { randomIdGenerator } from "../../../global/utils/randomIdGenerator";
/**
 * @slot default - Ska vara formulärselement. Till exempel digi-form-input.
 * @swedishName Fältgruppering
 */
export class FormFieldset {
    constructor() {
        this.afLegend = undefined;
        this.afName = undefined;
        this.afForm = undefined;
        this.afId = randomIdGenerator('digi-form-fieldset');
    }
    render() {
        return (h("fieldset", { key: 'a7a58d88cd63c80e2ea6a1dabb87e047e9c00b2c', class: "digi-form-fieldset", name: this.afName, form: this.afForm, id: this.afId }, this.afLegend && (h("legend", { key: 'a6042cfa25c5fd53fd7efd27de0a041ba36eb24b', class: "digi-form-fieldset__legend" }, this.afLegend)), h("slot", { key: '0c301feeafa741c6ec844d3b55cb1ef487f74c3b' })));
    }
    static get is() { return "digi-form-fieldset"; }
    static get encapsulation() { return "scoped"; }
    static get originalStyleUrls() {
        return {
            "$": ["form-fieldset.scss"]
        };
    }
    static get styleUrls() {
        return {
            "$": ["form-fieldset.css"]
        };
    }
    static get properties() {
        return {
            "afLegend": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [{
                            "name": "en",
                            "text": "The legend text."
                        }],
                    "text": "Legend-elementets text."
                },
                "getter": false,
                "setter": false,
                "attribute": "af-legend",
                "reflect": false
            },
            "afName": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [{
                            "name": "en",
                            "text": "The fieldset name attribute."
                        }],
                    "text": "Fieldset-elementets namn attribut."
                },
                "getter": false,
                "setter": false,
                "attribute": "af-name",
                "reflect": false
            },
            "afForm": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [{
                            "name": "en",
                            "text": "The fieldset form attribute."
                        }],
                    "text": "Fieldset-elementets form attribut."
                },
                "getter": false,
                "setter": false,
                "attribute": "af-form",
                "reflect": false
            },
            "afId": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [{
                            "name": "en",
                            "text": "Input id attribute. Defaults to random string."
                        }],
                    "text": "S\u00E4tter attributet 'id'. Om inget v\u00E4ljs s\u00E5 skapas ett slumpm\u00E4ssigt id."
                },
                "getter": false,
                "setter": false,
                "attribute": "af-id",
                "reflect": false,
                "defaultValue": "randomIdGenerator('digi-form-fieldset')"
            }
        };
    }
}
