UNPKG

1.3 kBJavaScriptView Raw
1import { r as registerInstance, h } from './index-d9cbe763.js';
2
3const 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}";
4
5const Checkbox = class {
6 constructor(hostRef) {
7 registerInstance(this, hostRef);
8 /**
9 * CSS Classes
10 */
11 this.class = '';
12 /**
13 * Label classes
14 */
15 this.labelClass = '';
16 /**
17 * Checked
18 */
19 this.checked = false;
20 /**
21 * Disabled
22 */
23 this.disabled = false;
24 }
25 render() {
26 return (h("label", { class: {
27 checkbox: true,
28 [this.labelClass]: Boolean(this.labelClass),
29 } }, h("input", { type: "checkbox", class: {
30 [this.class]: Boolean(this.class),
31 }, disabled: this.disabled, checked: this.checked }), h("slot", null)));
32 }
33};
34Checkbox.style = checkboxCss;
35
36export { Checkbox as bm_checkbox };