UNPKG

@bulmil/core

Version:

![bulmil](https://user-images.githubusercontent.com/2362138/65766959-c721a080-e16f-11e9-9fb9-45a5a2ad0391.jpg)

64 lines (59 loc) 1.88 kB
/*! * Bulmil - MIT License */ import { HTMLElement, h, proxyCustomElement } 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:#363636}[disabled].radio,[disabled].checkbox,fieldset[disabled] .radio,fieldset[disabled] .checkbox,.radio input[disabled],.checkbox input[disabled]{color:#7a7a7a;cursor:not-allowed}.radio+.radio{margin-left:0.5em}"; let Radio = class extends HTMLElement { constructor() { super(); this.__registerHost(); /** * Input class */ this.inputClass = ''; /** * Label Classes */ this.labelClass = ''; /** * Checked */ this.checked = false; /** * Disabled */ this.disabled = false; } render() { return (h("label", { class: { radio: true, [this.labelClass]: Boolean(this.labelClass), } }, h("input", { class: { [this.inputClass]: Boolean(this.inputClass), }, type: "radio", name: this.name, disabled: this.disabled, checked: this.checked }), h("slot", null))); } static get style() { return radioCss; } }; Radio = /*@__PURE__*/ proxyCustomElement(Radio, [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 };