import { h, Host } from "@stencil/core";
/**
 * @slot default - Ska vara en textnod
 *
 *@swedishName Intern länk
 */
export class LinkInternal {
    constructor() {
        this.afHref = undefined;
        this.afDescribedby = undefined;
        this.afAriaLabel = undefined;
        this.afOverrideLink = false;
        this.afLinkContainer = false;
        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: '77666487ac73e693e9a8f01dfbcb8dd2cee5dcda' }, !this.afLinkContainer && (h("digi-link", { key: '6951f6a244905ea3aa89a4fbfaa025351de9fca5', class: Object.assign({ 'digi-link-internal': true }, this.cssModifiers), afHref: this.afHref, afOverrideLink: this.afOverrideLink, afLinkContainer: this.afLinkContainer, onAfOnClick: (e) => this.clickLinkHandler(e), afDescribedby: this.afDescribedby, afAriaLabel: this.afAriaLabel }, h("digi-icon-chevron-right", { key: '088e4dfabc171906934fc35f5e2d3848c4c0b69f', class: "digi-link-internal__icon", "aria-hidden": "true", slot: "icon" }), h("slot", { key: '9bb553128c71b2fefd1961f75dc65a723eb514cb' }))), this.afLinkContainer && (h("digi-link", { key: 'def10c1eb9d913a76fe9c63567c112a25527831f', afHref: this.afHref, afOverrideLink: true, afLinkContainer: this.afLinkContainer, onAfOnClick: (e) => this.clickLinkHandler(e), afDescribedby: this.afDescribedby, afAriaLabel: this.afAriaLabel }, h("slot", { key: '66a3f15f0b3c41d3d7076948c5bcb716dc4b983a' })))));
    }
    static get is() { return "digi-link-internal"; }
    static get encapsulation() { return "scoped"; }
    static get originalStyleUrls() {
        return {
            "$": ["link-internal.scss"]
        };
    }
    static get styleUrls() {
        return {
            "$": ["link-internal.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
            },
            "afOverrideLink": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [{
                            "name": "en",
                            "text": "Override default link behavior. Should only be used if default link behaviour is a problem with e.g. routing"
                        }],
                    "text": "Kringg\u00E5r l\u00E4nkens vanliga beteende.\nB\u00F6r endast anv\u00E4ndas om det vanliga beteendet \u00E4r problematiskt pga dynamisk routing eller liknande."
                },
                "getter": false,
                "setter": false,
                "attribute": "af-override-link",
                "reflect": false,
                "defaultValue": "false"
            },
            "afLinkContainer": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [{
                            "name": "en",
                            "text": "Set to true if using Angular"
                        }],
                    "text": "S\u00E4tt till true om du anv\u00E4nder Angular, se exempelkod under '\u00D6versikt'"
                },
                "getter": false,
                "setter": false,
                "attribute": "af-link-container",
                "reflect": false,
                "defaultValue": "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"; }
}
