import { h } from "@stencil/core";
import { randomIdGenerator } from "../../../global/utils/randomIdGenerator";
import { TableSize } from "./table-size.enum";
import { TableVariation } from "./table-variation.enum";
/**
 * @slot default - Ska innehålla ett table-element
 *
 * @enums TableSize - table-size.enum.ts
 * @enums TableVariation - table-variation.enum.ts
 * @swedishName Tabell
 */
export class Table {
    constructor() {
        this.afVariation = TableVariation.PRIMARY;
        this.afSize = TableSize.MEDIUM;
        this.afId = randomIdGenerator('digi-navigation-breadcrumbs');
    }
    get cssModifiers() {
        return {
            'digi-table--primary': this.afVariation === TableVariation.PRIMARY,
            'digi-table--secondary': this.afVariation === TableVariation.SECONDARY,
            'digi-table--tertiary': this.afVariation === TableVariation.TERTIARY,
            'digi-table--small': this.afSize === TableSize.SMALL
        };
    }
    render() {
        return (h("div", { key: 'dcd3efdeca446511236c2292c9aad492fae9f282', class: Object.assign({ 'digi-table': true }, this.cssModifiers) }, h("div", { key: 'e1e00b00ff361dc61be31b23005049a48b2763dc', class: "digi-table__scroll-container" }, h("slot", { key: 'c046d3062db86b03388ec42dd68edf1593c1bab1' }))));
    }
    static get is() { return "digi-table"; }
    static get originalStyleUrls() {
        return {
            "$": ["table.scss"]
        };
    }
    static get styleUrls() {
        return {
            "$": ["table.css"]
        };
    }
    static get properties() {
        return {
            "afVariation": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "TableVariation",
                    "resolved": "TableVariation.PRIMARY | TableVariation.SECONDARY | TableVariation.TERTIARY",
                    "references": {
                        "TableVariation": {
                            "location": "import",
                            "path": "./table-variation.enum",
                            "id": "src/components/_table/table/table-variation.enum.ts::TableVariation"
                        }
                    }
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [{
                            "name": "en",
                            "text": "Set variation. Can be 'primary', 'secondary' or 'tertiary'."
                        }],
                    "text": "S\u00E4tter variant. Kan vara 'primary', 'secondary' eller 'tertiary'."
                },
                "getter": false,
                "setter": false,
                "attribute": "af-variation",
                "reflect": false,
                "defaultValue": "TableVariation.PRIMARY"
            },
            "afSize": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "TableSize",
                    "resolved": "TableSize.MEDIUM | TableSize.SMALL",
                    "references": {
                        "TableSize": {
                            "location": "import",
                            "path": "./table-size.enum",
                            "id": "src/components/_table/table/table-size.enum.ts::TableSize"
                        }
                    }
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [{
                            "name": "en",
                            "text": "Set size. Can be 'small' or 'medium'."
                        }],
                    "text": "S\u00E4tter storlek. Kan vara 'small' eller 'medium'."
                },
                "getter": false,
                "setter": false,
                "attribute": "af-size",
                "reflect": false,
                "defaultValue": "TableSize.MEDIUM"
            },
            "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-navigation-breadcrumbs')"
            }
        };
    }
}
