UNPKG

v4web-components

Version:
141 lines (140 loc) 3.52 kB
import { h } from '@stencil/core'; export class LabDsRadioButton { constructor() { this.label = undefined; this.avatar = false; this.error = false; this.disabled = false; this.checked = false; } handleClick() { this.handleRadioButton.emit(this.checked); } render() { return (h("label", { class: `container ${this.disabled ? 'disabled' : ''}` }, h("input", { checked: this.checked, onClick: () => this.handleClick(), disabled: this.disabled, type: "radio" }), this.avatar ? h("lab-ds-avatar", { size: "small" }) : null, h("span", { class: `label-text ${this.checked ? 'checked' : ''}` }, this.label))); } static get is() { return "lab-ds-radio-button"; } static get encapsulation() { return "shadow"; } static get originalStyleUrls() { return { "$": ["lab-ds-radio-button.css"] }; } static get styleUrls() { return { "$": ["lab-ds-radio-button.css"] }; } static get properties() { return { "label": { "type": "string", "mutable": false, "complexType": { "original": "string", "resolved": "string", "references": {} }, "required": true, "optional": false, "docs": { "tags": [], "text": "" }, "attribute": "label", "reflect": false }, "avatar": { "type": "boolean", "mutable": false, "complexType": { "original": "boolean", "resolved": "boolean", "references": {} }, "required": false, "optional": false, "docs": { "tags": [], "text": "" }, "attribute": "avatar", "reflect": false, "defaultValue": "false" }, "error": { "type": "boolean", "mutable": false, "complexType": { "original": "boolean", "resolved": "boolean", "references": {} }, "required": false, "optional": false, "docs": { "tags": [], "text": "" }, "attribute": "error", "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" }, "checked": { "type": "boolean", "mutable": false, "complexType": { "original": "boolean", "resolved": "boolean", "references": {} }, "required": false, "optional": false, "docs": { "tags": [], "text": "" }, "attribute": "checked", "reflect": false, "defaultValue": "false" } }; } static get events() { return [{ "method": "handleRadioButton", "name": "handleRadioButton", "bubbles": true, "cancelable": true, "composed": true, "docs": { "tags": [], "text": "" }, "complexType": { "original": "any", "resolved": "any", "references": {} } }]; } } //# sourceMappingURL=lab-ds-radio-button.js.map