UNPKG

@intuitionrobotics/thunderstorm

Version:
33 lines 1.95 kB
import * as React from "react"; import {} from "react"; export class TS_Checkbox extends React.Component { render() { const defaultButtonStyle = { borderRadius: this.props.circle ? "50%" : "1px", border: "1px solid #68678d50", boxShadow: "0px 0 1px 0px #867979", marginRight: this.props.rtl ? 'unset' : 10, marginLeft: this.props.rtl ? 10 : 'unset', }; const radioContainer = { cursor: !this.props.disabled && this.props.onCheck ? "pointer" : "inherit" }; const btnInner = { width: 15, height: 15, borderRadius: this.props.circle ? "50%" : "1px", boxSizing: "border-box" }; if (this.props.checked) { btnInner.border = "4.5px #3499fe solid"; if (!this.props.circle) btnInner.background = "#3499fe"; } return React.createElement("div", { className: `${this.props.containerClass && this.props.containerClass(this.props.checked, !!this.props.disabled)} ll_h_c`, style: radioContainer, id: this.props.id, onClick: () => !this.props.disabled && this.props.onCheck && this.props.onCheck(this.props.value, this.props.checked) }, this.props.rtl && this.renderLabel(), React.createElement("div", { style: this.props.buttonClass ? {} : defaultButtonStyle, className: this.props.buttonClass && this.props.buttonClass(this.props.checked, !!this.props.disabled) }, this.props.innerNode ? this.props.innerNode(this.props.checked, !!this.props.disabled) : React.createElement("div", { style: btnInner })), !this.props.rtl && this.renderLabel()); } renderLabel = () => React.createElement("div", { className: 'match_width' }, typeof this.props.label === "function" ? this.props.label(this.props.checked, !!this.props.disabled) : this.props.label); } //# sourceMappingURL=TS_Checkbox.js.map