UNPKG

v4web-components

Version:
142 lines (141 loc) 3.54 kB
import { h } from '@stencil/core'; export class LabDsChip { constructor() { this.avatar = false; this.size = 'medium'; this.label = undefined; this.nameAvatar = undefined; this.imageSRCAvatar = undefined; } handleClickChip() { this.handleCloseChip.emit(); } render() { return (h("button", { class: `${this.size} ${this.avatar && 'with-avatar'} chip` }, this.avatar && h("lab-ds-avatar", { imageSRC: this.imageSRCAvatar, name: this.nameAvatar, size: "small" }), " ", h("span", { class: "label" }, this.label), ' ', h("lab-ds-icon-selectable", { onClick: e => { this.handleClickChip(); e.stopPropagation(); }, class: "holder", size: "small", icon: "close" }))); } static get is() { return "lab-ds-chip"; } static get encapsulation() { return "shadow"; } static get originalStyleUrls() { return { "$": ["lab-ds-chip.css"] }; } static get styleUrls() { return { "$": ["lab-ds-chip.css"] }; } static get properties() { return { "avatar": { "type": "boolean", "mutable": false, "complexType": { "original": "boolean", "resolved": "boolean", "references": {} }, "required": false, "optional": false, "docs": { "tags": [], "text": "" }, "attribute": "avatar", "reflect": false, "defaultValue": "false" }, "size": { "type": "string", "mutable": false, "complexType": { "original": "'medium' | 'small'", "resolved": "\"medium\" | \"small\"", "references": {} }, "required": false, "optional": false, "docs": { "tags": [], "text": "" }, "attribute": "size", "reflect": false, "defaultValue": "'medium'" }, "label": { "type": "string", "mutable": false, "complexType": { "original": "string", "resolved": "string", "references": {} }, "required": false, "optional": false, "docs": { "tags": [], "text": "" }, "attribute": "label", "reflect": false }, "nameAvatar": { "type": "string", "mutable": false, "complexType": { "original": "string", "resolved": "string", "references": {} }, "required": false, "optional": false, "docs": { "tags": [], "text": "" }, "attribute": "name-avatar", "reflect": false }, "imageSRCAvatar": { "type": "string", "mutable": false, "complexType": { "original": "string", "resolved": "string", "references": {} }, "required": false, "optional": false, "docs": { "tags": [], "text": "" }, "attribute": "image-s-r-c-avatar", "reflect": false } }; } static get events() { return [{ "method": "handleCloseChip", "name": "handleCloseChip", "bubbles": true, "cancelable": true, "composed": true, "docs": { "tags": [], "text": "" }, "complexType": { "original": "any", "resolved": "any", "references": {} } }]; } } //# sourceMappingURL=lab-ds-chip.js.map