@bulmil/core
Version:

53 lines (48 loc) • 2.11 kB
JavaScript
/*!
* Bulmil - MIT License
*/
import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
const radioCss = ".radio,.checkbox{cursor:pointer;display:inline-block;line-height:1.25;position:relative}.radio input,.checkbox input{cursor:pointer}.radio:hover,.checkbox:hover{color:hsl(0, 0%, 21%)}[disabled].radio,[disabled].checkbox,fieldset[disabled] .radio,fieldset[disabled] .checkbox,.radio input[disabled],.checkbox input[disabled]{color:hsl(0, 0%, 48%);cursor:not-allowed}.radio+.radio{margin-left:0.5em}";
const BmRadioStyle0 = radioCss;
const Radio = /*@__PURE__*/ proxyCustomElement(class Radio extends HTMLElement {
constructor() {
super();
this.__registerHost();
this.inputClass = '';
this.labelClass = '';
this.name = undefined;
this.checked = false;
this.disabled = false;
}
render() {
return (h("label", { key: '27a18d20792014cb8b056aa665b91adb6af02550', class: {
radio: true,
[this.labelClass]: Boolean(this.labelClass),
} }, h("input", { key: 'da8fecbc2e432adcefb6db8a1ef4bb19bb3be8b3', class: {
[this.inputClass]: Boolean(this.inputClass),
}, type: "radio", name: this.name, disabled: this.disabled, checked: this.checked }), h("slot", { key: 'b976e7f4a4802b0501143f53af0ef72142066d52' })));
}
static get style() { return BmRadioStyle0; }
}, [4, "bm-radio", {
"inputClass": [1, "input-class"],
"labelClass": [1, "label-class"],
"name": [1],
"checked": [4],
"disabled": [4]
}]);
function defineCustomElement$1() {
if (typeof customElements === "undefined") {
return;
}
const components = ["bm-radio"];
components.forEach(tagName => { switch (tagName) {
case "bm-radio":
if (!customElements.get(tagName)) {
customElements.define(tagName, Radio);
}
break;
} });
}
const BmRadio = Radio;
const defineCustomElement = defineCustomElement$1;
export { BmRadio, defineCustomElement };