import { Fragment, h, Host } from "@stencil/core";
import { TileClass } from "./constants";
import { govHost } from "../../helpers/Dom/template";
export class GovTile {
    constructor() {
        /**
         * Tile’s size
         */
        this.size = "m";
        /**
         * Tiles border
         */
        this.noBorder = false;
        this.h = govHost(this.host);
    }
    render() {
        return (h(Host, { key: '31fcebee125c753089b2229cea0033dce9aa3133', class: this.h.classes(TileClass.root), size: this.size, orientation: this.orientation, clickable: this.href ? true : null }, h("slot", { key: 'b79748ea55bb2e86d887860c1143d82d75497966', name: "icon" }), h("div", { key: 'db8b61554f6943612c9d7165174926cfd205fcfb', class: TileClass.content }, h("div", { key: 'e844267c106109d0470176d3c89539f8f987c70f', class: TileClass.text }, h("div", { key: 'e4771f568d8848b87045293ebb10af5679f1a3b7', class: TileClass.title }, this.href ? (h(Fragment, null, h("a", { href: this.href, target: this.target, class: TileClass.link, ref: el => (this.triggerRef = el) }, h("slot", { name: "title" })), h("span", { class: TileClass.icon }, h("gov-icon", { name: "chevron-right", type: "components" })))) : (h("slot", { name: "title" }))), h("div", { key: 'cf1bf1a1c29e8879dc509b484325b82808db792a', class: `${TileClass.annotation} ${this.href ? `${TileClass.annotation}--padding` : ''}` }, h("slot", { key: '9a10f28fd144f1131eae6735342da9a5d93665e2' }))), h("slot", { key: '067476f1a27bad0fb50d86789a729f93b1f1e5ad', name: "button" }))));
    }
    /**
     * Returns a clickable element instance
     */
    async getTriggerRef() {
        return this.triggerRef;
    }
    static get is() { return "gov-tile"; }
    static get properties() {
        return {
            "size": {
                "type": "string",
                "attribute": "size",
                "mutable": false,
                "complexType": {
                    "original": "TileSizesType",
                    "resolved": "\"l\" | \"m\" | \"s\"",
                    "references": {
                        "TileSizesType": {
                            "location": "import",
                            "path": "./constants",
                            "id": "../../../packages/core/src/components/gov-tile/constants.ts::TileSizesType"
                        }
                    }
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "Tile\u2019s size"
                },
                "getter": false,
                "setter": false,
                "reflect": true,
                "defaultValue": "\"m\""
            },
            "orientation": {
                "type": "string",
                "attribute": "orientation",
                "mutable": false,
                "complexType": {
                    "original": "\"vertical\" | \"horizontal\"",
                    "resolved": "\"horizontal\" | \"vertical\"",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Style variation of the tile."
                },
                "getter": false,
                "setter": false,
                "reflect": false
            },
            "noBorder": {
                "type": "boolean",
                "attribute": "no-border",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Tiles border"
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "defaultValue": "false"
            },
            "href": {
                "type": "string",
                "attribute": "href",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": "Link on whole tile"
                },
                "getter": false,
                "setter": false,
                "reflect": true
            },
            "target": {
                "type": "string",
                "attribute": "target",
                "mutable": false,
                "complexType": {
                    "original": "ButtonTargetType",
                    "resolved": "\"_blank\" | \"_new\" | \"_self\"",
                    "references": {
                        "ButtonTargetType": {
                            "location": "import",
                            "path": "../gov-button/button/constants",
                            "id": "../../../packages/core/src/components/gov-button/button/constants.ts::ButtonTargetType"
                        }
                    }
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [{
                            "name": "link",
                            "text": "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-target"
                        }],
                    "text": "Same as original parameter"
                },
                "getter": false,
                "setter": false,
                "reflect": false
            }
        };
    }
    static get methods() {
        return {
            "getTriggerRef": {
                "complexType": {
                    "signature": "() => Promise<HTMLLinkElement | HTMLSpanElement>",
                    "parameters": [],
                    "references": {
                        "Promise": {
                            "location": "global",
                            "id": "global::Promise"
                        },
                        "HTMLLinkElement": {
                            "location": "global",
                            "id": "global::HTMLLinkElement"
                        },
                        "HTMLSpanElement": {
                            "location": "global",
                            "id": "global::HTMLSpanElement"
                        }
                    },
                    "return": "Promise<HTMLLinkElement | HTMLSpanElement>"
                },
                "docs": {
                    "text": "Returns a clickable element instance",
                    "tags": []
                }
            }
        };
    }
    static get elementRef() { return "host"; }
}
//# sourceMappingURL=gov-tile.js.map
