UNPKG

@bulmil/core

Version:

![bulmil](https://user-images.githubusercontent.com/2362138/65766959-c721a080-e16f-11e9-9fb9-45a5a2ad0391.jpg)

168 lines (167 loc) 5.56 kB
/*! * Bulmil - MIT License */ import { h, Host } from "@stencil/core"; export class Switch { constructor() { this.onClick = () => { this.checked = !this.checked; }; this.color = undefined; this.size = undefined; this.isThin = false; this.isRounded = false; this.isOutlined = false; this.disabled = false; this.checked = false; } render() { return (h(Host, { key: '2d9030c0e36b398a187f392f026739babf98ddd4', onClick: this.onClick }, h("input", { key: 'd0b825e0a7c0bd2bd630a22dcc0b0e52ac19e746', type: "checkbox", class: { switch: true, [this.color]: Boolean(this.color), [this.size]: Boolean(this.size), 'is-thin': this.isThin, 'is-rounded': this.isRounded, 'is-outlined': this.isOutlined, }, checked: this.checked, disabled: this.disabled }), h("label", { key: 'cd8f14afbcae77c61beb246d951c504ecb80ecbb' }, h("slot", { key: '9d0d5728c50123d0ae9890004a55b765bb465cf5' })))); } static get is() { return "bm-switch"; } static get originalStyleUrls() { return { "$": ["switch.scss"] }; } static get styleUrls() { return { "$": ["switch.css"] }; } static get properties() { return { "color": { "type": "string", "mutable": false, "complexType": { "original": "'is-success' | 'is-warning' | 'is-danger' | 'is-info'", "resolved": "\"is-danger\" | \"is-info\" | \"is-success\" | \"is-warning\"", "references": {} }, "required": false, "optional": false, "docs": { "tags": [], "text": "Color" }, "attribute": "color", "reflect": false }, "size": { "type": "string", "mutable": false, "complexType": { "original": "'is-small' | 'is-medium' | 'is-large'", "resolved": "\"is-large\" | \"is-medium\" | \"is-small\"", "references": {} }, "required": false, "optional": false, "docs": { "tags": [], "text": "Size" }, "attribute": "size", "reflect": false }, "isThin": { "type": "boolean", "mutable": false, "complexType": { "original": "boolean", "resolved": "boolean", "references": {} }, "required": false, "optional": false, "docs": { "tags": [], "text": "Thin" }, "attribute": "is-thin", "reflect": false, "defaultValue": "false" }, "isRounded": { "type": "boolean", "mutable": false, "complexType": { "original": "boolean", "resolved": "boolean", "references": {} }, "required": false, "optional": false, "docs": { "tags": [], "text": "Rounded" }, "attribute": "is-rounded", "reflect": false, "defaultValue": "false" }, "isOutlined": { "type": "boolean", "mutable": false, "complexType": { "original": "boolean", "resolved": "boolean", "references": {} }, "required": false, "optional": false, "docs": { "tags": [], "text": "Outlined" }, "attribute": "is-outlined", "reflect": false, "defaultValue": "false" }, "disabled": { "type": "boolean", "mutable": false, "complexType": { "original": "boolean", "resolved": "boolean", "references": {} }, "required": false, "optional": false, "docs": { "tags": [], "text": "Disabled" }, "attribute": "disabled", "reflect": false, "defaultValue": "false" }, "checked": { "type": "boolean", "mutable": true, "complexType": { "original": "boolean", "resolved": "boolean", "references": {} }, "required": false, "optional": false, "docs": { "tags": [], "text": "Checked" }, "attribute": "checked", "reflect": false, "defaultValue": "false" } }; } }