import { h } from "@stencil/core";
/**
 * Link 链接组件
 * 文字超链接
 */
export class Link {
    /**
     * 类型
     * @default 'default'
     */
    type = 'default';
    /**
     * 是否下划线
     * @default false
     */
    underline = false;
    /**
     * 是否禁用状态
     * @default false
     */
    disabled = false;
    /**
     * 原生 href 属性
     */
    href;
    /**
     * 原生 target 属性
     */
    target;
    /**
     * 图标类名
     */
    icon;
    /**
     * 点击事件
     */
    hbClick;
    handleClick = (e) => {
        if (this.disabled) {
            e.preventDefault();
            return;
        }
        this.hbClick.emit(e);
    };
    render() {
        const Tag = this.href ? 'a' : 'span';
        return (h(Tag, { key: 'f4aac8cc7a366ae0c9b4b24fa0d3ee80f79da58b', class: {
                'hb-link': true,
                [`hb-link--${this.type}`]: true,
                'hb-link--underline': this.underline,
                'hb-link--disabled': this.disabled,
            }, href: this.disabled ? undefined : this.href, target: this.target, onClick: this.handleClick }, this.icon && h("i", { key: '4b2675a1daf216c9ee79ea12bcab5ed24fd858ca', class: this.icon }), h("slot", { key: '948264261fa279325d939820adb2c67ae7aaf465' })));
    }
    static get is() { return "hb-link"; }
    static get encapsulation() { return "shadow"; }
    static get originalStyleUrls() {
        return {
            "$": ["link.css"]
        };
    }
    static get styleUrls() {
        return {
            "$": ["link.css"]
        };
    }
    static get properties() {
        return {
            "type": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "'primary' | 'success' | 'warning' | 'danger' | 'info' | 'default'",
                    "resolved": "\"danger\" | \"default\" | \"info\" | \"primary\" | \"success\" | \"warning\"",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [{
                            "name": "default",
                            "text": "'default'"
                        }],
                    "text": "\u7C7B\u578B"
                },
                "getter": false,
                "setter": false,
                "attribute": "type",
                "reflect": false,
                "defaultValue": "'default'"
            },
            "underline": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [{
                            "name": "default",
                            "text": "false"
                        }],
                    "text": "\u662F\u5426\u4E0B\u5212\u7EBF"
                },
                "getter": false,
                "setter": false,
                "attribute": "underline",
                "reflect": false,
                "defaultValue": "false"
            },
            "disabled": {
                "type": "boolean",
                "mutable": false,
                "complexType": {
                    "original": "boolean",
                    "resolved": "boolean",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [{
                            "name": "default",
                            "text": "false"
                        }],
                    "text": "\u662F\u5426\u7981\u7528\u72B6\u6001"
                },
                "getter": false,
                "setter": false,
                "attribute": "disabled",
                "reflect": false,
                "defaultValue": "false"
            },
            "href": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "\u539F\u751F href \u5C5E\u6027"
                },
                "getter": false,
                "setter": false,
                "attribute": "href",
                "reflect": false
            },
            "target": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "\u539F\u751F target \u5C5E\u6027"
                },
                "getter": false,
                "setter": false,
                "attribute": "target",
                "reflect": false
            },
            "icon": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": "\u56FE\u6807\u7C7B\u540D"
                },
                "getter": false,
                "setter": false,
                "attribute": "icon",
                "reflect": false
            }
        };
    }
    static get events() {
        return [{
                "method": "hbClick",
                "name": "hbClick",
                "bubbles": true,
                "cancelable": true,
                "composed": true,
                "docs": {
                    "tags": [],
                    "text": "\u70B9\u51FB\u4E8B\u4EF6"
                },
                "complexType": {
                    "original": "MouseEvent",
                    "resolved": "MouseEvent",
                    "references": {
                        "MouseEvent": {
                            "location": "global",
                            "id": "global::MouseEvent"
                        }
                    }
                }
            }];
    }
}
//# sourceMappingURL=Link.js.map
