import { h, Host } from "@stencil/core";
/**
 * @slot default - Ska vara en textnod
 *
 *@swedishName Extern länk
 */
export class LinkExternal {
    constructor() {
        this.afHref = undefined;
        this.afDescribedby = undefined;
        this.afAriaLabel = undefined;
        this.afTarget = undefined;
        this.hideVisitedColor = undefined;
    }
    clickLinkHandler(e) {
        e.stopImmediatePropagation();
        this.afOnClick.emit(e.detail);
    }
    get cssModifiers() {
        return {
            'digi-link--hide-visited': this.hideVisitedColor
        };
    }
    render() {
        return (h(Host, { key: '6c080c10809f59a44ba7b6ddb3422097edc8ac4f' }, h("digi-link", { key: 'bb6e809911b5d664d86a24879f3911d4ce7fd69d', class: Object.assign({ 'digi-link-external': true }, this.cssModifiers), afHref: this.afHref, onAfOnClick: (e) => this.clickLinkHandler(e), afTarget: this.afTarget, afDescribedby: this.afDescribedby, afAriaLabel: this.afAriaLabel }, h("digi-icon-external-link-alt", { key: '43a515d70adc78ec4b67d4916f1aadeb4f2279a7', class: "digi-link-external__icon", "aria-hidden": "true", slot: "icon" }), h("slot", { key: 'f31becb5e56a50b3d578093a9388d3ffef21e889' }))));
    }
    static get is() { return "digi-link-external"; }
    static get encapsulation() { return "scoped"; }
    static get originalStyleUrls() {
        return {
            "$": ["link-external.scss"]
        };
    }
    static get styleUrls() {
        return {
            "$": ["link-external.css"]
        };
    }
    static get properties() {
        return {
            "afHref": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": true,
                "optional": false,
                "docs": {
                    "tags": [{
                            "name": "en",
                            "text": "Set `href` attribute."
                        }],
                    "text": "S\u00E4tter attributet 'href'."
                },
                "getter": false,
                "setter": false,
                "attribute": "af-href",
                "reflect": false
            },
            "afDescribedby": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [{
                            "name": "en",
                            "text": "Sets `aria-describedby` attribute."
                        }],
                    "text": "S\u00E4tter attributet 'aria-describedby'."
                },
                "getter": false,
                "setter": false,
                "attribute": "af-describedby",
                "reflect": false
            },
            "afAriaLabel": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [{
                            "name": "en",
                            "text": "Sets `aria-label` attribute."
                        }],
                    "text": "S\u00E4tter attributet 'aria-label'."
                },
                "getter": false,
                "setter": false,
                "attribute": "af-aria-label",
                "reflect": false
            },
            "afTarget": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [{
                            "name": "en",
                            "text": "Set `target` attribute. If value is '_blank', the component automatically adds a 'ref' attribute with 'noopener noreferrer'."
                        }],
                    "text": "S\u00E4tter attributet 'target'. Om v\u00E4rdet \u00E4r '_blank' s\u00E5 l\u00E4gger komponenten automatikt till ett \u00B4ref\u00B4-attribut med 'noopener noreferrer'."
                },
                "getter": false,
                "setter": false,
                "attribute": "af-target",
                "reflect": false
            },
            "hideVisitedColor": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [{
                            "name": "en",
                            "text": "If link color should change when visited"
                        }],
                    "text": "Avg\u00F6r om f\u00E4rgen ska \u00E4ndras p\u00E5 bes\u00F6kta l\u00E4nkar"
                },
                "getter": false,
                "setter": false,
                "attribute": "hide-visited-color",
                "reflect": false
            }
        };
    }
    static get events() {
        return [{
                "method": "afOnClick",
                "name": "afOnClick",
                "bubbles": true,
                "cancelable": true,
                "composed": true,
                "docs": {
                    "tags": [{
                            "name": "en",
                            "text": "The link element's 'onclick' event."
                        }],
                    "text": "L\u00E4nkelementets 'onclick'-event."
                },
                "complexType": {
                    "original": "MouseEvent",
                    "resolved": "MouseEvent",
                    "references": {
                        "MouseEvent": {
                            "location": "global",
                            "id": "global::MouseEvent"
                        }
                    }
                }
            }];
    }
    static get elementRef() { return "hostElement"; }
}
