@bulmil/core
Version:

168 lines (167 loc) • 5.56 kB
JavaScript
/*!
* 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: '2a53b2d0977ef0d163dfb8bd8acea6ffc7019958', onClick: this.onClick }, h("input", { key: 'e2c789cb9174e10c1a9f5a0009c9cd7029eb4b7a', 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: 'd61b53897d4e9db17e104f399cba803134d3ab62' }, h("slot", { key: '20ac58ab5240f7bc175008acfca5c0bf22bbfbf8' }))));
}
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"
}
};
}
}