UNPKG

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