UNPKG

bruno-ui

Version:
99 lines (98 loc) 3.09 kB
import { h } from "@stencil/core"; export class RadioButtonComponent { constructor() { this.type = "primary"; } render() { return (h("label", null, h("input", { type: "radio", name: this.name, checked: this.checked, onChange: e => this.OnChangeHandler(e) }), h("span", { class: `brn-radio__checkmark brn-radio__checkmark--${this.type}` }), h("span", { class: "brn-radio__text" }, h("slot", null)))); } OnChangeHandler(event) { this.changed.emit(event.target.checked); } static get is() { return "brn-radio"; } static get originalStyleUrls() { return { "$": ["radio.component.scss"] }; } static get styleUrls() { return { "$": ["radio.component.css"] }; } static get properties() { return { "checked": { "type": "boolean", "mutable": false, "complexType": { "original": "boolean", "resolved": "boolean", "references": {} }, "required": false, "optional": false, "docs": { "tags": [], "text": "" }, "attribute": "checked", "reflect": false }, "name": { "type": "string", "mutable": false, "complexType": { "original": "string", "resolved": "string", "references": {} }, "required": false, "optional": false, "docs": { "tags": [], "text": "" }, "attribute": "name", "reflect": false }, "type": { "type": "string", "mutable": false, "complexType": { "original": "keyof StyleType", "resolved": "\"danger\" | \"dark\" | \"info\" | \"light\" | \"primary\" | \"secondary\" | \"success\" | \"warning\"", "references": { "StyleType": { "location": "import", "path": "../../objects/types" } } }, "required": false, "optional": false, "docs": { "tags": [], "text": "" }, "attribute": "type", "reflect": false, "defaultValue": "\"primary\"" } }; } static get events() { return [{ "method": "changed", "name": "changed", "bubbles": true, "cancelable": true, "composed": true, "docs": { "tags": [], "text": "" }, "complexType": { "original": "boolean", "resolved": "boolean", "references": {} } }]; } }