UNPKG

@kelvininc/ui-components

Version:
136 lines (135 loc) 4.71 kB
import { Host, h } from "@stencil/core"; /** * @part container - The link's container */ export class KvLink { constructor() { this.onLabelClick = event => { this.labelClick.emit(event); }; } render() { return (h(Host, { key: '38b649400b666852add95f609e672f183eae4b74' }, h("div", { key: '5c6dca20672fca2fea6ca30d7140656c1971f6b3', class: "link-container", part: "container" }, h("a", { key: '5ef0ad5d47387e43335693a3f3b8734ef9c9efeb', class: "label", href: this.href, target: this.target, onClick: this.onLabelClick }, this.label), this.subtitle && h("div", { key: 'f1fb4925a9ef0e30727b7284814385de8756a673', class: "subtitle" }, this.subtitle)))); } static get is() { return "kv-link"; } static get encapsulation() { return "shadow"; } static get originalStyleUrls() { return { "$": ["link.scss"] }; } static get styleUrls() { return { "$": ["link.css"] }; } static get properties() { return { "label": { "type": "string", "attribute": "label", "mutable": false, "complexType": { "original": "string", "resolved": "string", "references": {} }, "required": true, "optional": false, "docs": { "tags": [], "text": "(required) Main component label" }, "getter": false, "setter": false, "reflect": true }, "subtitle": { "type": "string", "attribute": "subtitle", "mutable": false, "complexType": { "original": "string", "resolved": "string", "references": {} }, "required": false, "optional": true, "docs": { "tags": [], "text": "(optional) Description for the label" }, "getter": false, "setter": false, "reflect": true }, "href": { "type": "string", "attribute": "href", "mutable": false, "complexType": { "original": "string", "resolved": "string", "references": {} }, "required": false, "optional": true, "docs": { "tags": [], "text": "(optional) The link to open when clicking on the tag" }, "getter": false, "setter": false, "reflect": true }, "target": { "type": "string", "attribute": "target", "mutable": false, "complexType": { "original": "EAnchorTarget", "resolved": "EAnchorTarget.BrowserDefault | EAnchorTarget.NewTab | EAnchorTarget.Parent | EAnchorTarget.Top", "references": { "EAnchorTarget": { "location": "import", "path": "../../types", "id": "src/types.ts::EAnchorTarget" } } }, "required": false, "optional": true, "docs": { "tags": [], "text": "(optional) The link to open when clicking on the tag" }, "getter": false, "setter": false, "reflect": true } }; } static get events() { return [{ "method": "labelClick", "name": "labelClick", "bubbles": true, "cancelable": true, "composed": true, "docs": { "tags": [], "text": "Emitted when clicking the label" }, "complexType": { "original": "MouseEvent", "resolved": "MouseEvent", "references": { "MouseEvent": { "location": "global", "id": "global::MouseEvent" } } } }]; } }