UNPKG

v4web-components

Version:
125 lines (124 loc) 3.12 kB
import { h } from '@stencil/core'; export class LabDsFilterChip { constructor() { this.selected = false; this.disabled = false; this.size = 'medium'; this.label = undefined; } handleClickChip() { this.handleSelectedChip.emit(this.selected); } render() { return (h("button", { disabled: this.disabled, onClick: e => { this.handleClickChip(); e.stopPropagation(); }, class: `${this.size} ${this.selected && 'selected'} filter-chip` }, h("span", { class: "label" }, this.label), " ", this.selected && h("lab-ds-icon-not-selectable", { class: "holder", size: "small", icon: "check" }))); } static get is() { return "lab-ds-filter-chip"; } static get encapsulation() { return "shadow"; } static get originalStyleUrls() { return { "$": ["lab-ds-filter-chip.css"] }; } static get styleUrls() { return { "$": ["lab-ds-filter-chip.css"] }; } static get properties() { return { "selected": { "type": "boolean", "mutable": false, "complexType": { "original": "boolean", "resolved": "boolean", "references": {} }, "required": false, "optional": false, "docs": { "tags": [], "text": "" }, "attribute": "selected", "reflect": false, "defaultValue": "false" }, "disabled": { "type": "boolean", "mutable": false, "complexType": { "original": "boolean", "resolved": "boolean", "references": {} }, "required": false, "optional": false, "docs": { "tags": [], "text": "" }, "attribute": "disabled", "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 } }; } static get events() { return [{ "method": "handleSelectedChip", "name": "handleSelectedChip", "bubbles": true, "cancelable": true, "composed": true, "docs": { "tags": [], "text": "" }, "complexType": { "original": "any", "resolved": "any", "references": {} } }]; } } //# sourceMappingURL=lab-ds-filter-chip.js.map