UNPKG

1.4 kBJavaScriptView Raw
1'use strict';
2
3Object.defineProperty(exports, '__esModule', { value: true });
4
5const index = require('./index-8e7d875f.js');
6
7const checkboxCss = ".radio,.checkbox{cursor:pointer;display:inline-block;line-height:1.25;position:relative}.radio input,.checkbox input{cursor:pointer}.radio:hover,.checkbox:hover{color:#363636}[disabled].radio,[disabled].checkbox,fieldset[disabled] .radio,fieldset[disabled] .checkbox{color:#7a7a7a;cursor:not-allowed}.radio+.radio{margin-left:0.5em}bm-checkbox[disabled=true] .checkbox{color:#7a7a7a;cursor:not-allowed}";
8
9const Checkbox = class {
10 constructor(hostRef) {
11 index.registerInstance(this, hostRef);
12 /**
13 * Input classes
14 */
15 this.inputClass = '';
16 /**
17 * Label classes
18 */
19 this.labelClass = '';
20 /**
21 * Checked
22 */
23 this.checked = false;
24 /**
25 * Disabled
26 */
27 this.disabled = false;
28 }
29 render() {
30 return (index.h("label", { class: {
31 checkbox: true,
32 [this.labelClass]: Boolean(this.labelClass),
33 } }, index.h("input", { type: "checkbox", class: {
34 [this.inputClass]: Boolean(this.inputClass),
35 }, disabled: this.disabled, checked: this.checked }), index.h("slot", null)));
36 }
37};
38Checkbox.style = checkboxCss;
39
40exports.bm_checkbox = Checkbox;