react-input-checkbox
Version:
Simple and stylable checkbox UI component for React apps
2 lines (1 loc) • 1.94 kB
JavaScript
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("prop-types")):"function"==typeof define&&define.amd?define(["exports","react","prop-types"],t):t((e=e||self).Checkbox={},e.React)}(this,function(e,c){"use strict";function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}c=c&&Object.prototype.hasOwnProperty.call(c,"default")?c.default:c;function a(n){var e=t(n);return"string"===e||"number"===e?n||"":Array.isArray(n)&&0<n.length?n.reduce(function(e,t){return t?e.concat("".concat(t," ")):e},""):Object.keys(n).reduce(function(e,t){return n[t]?e.concat("".concat(t," ")):e},"")}function n(e){var t,n,o,i;return c.createElement("label",{className:a((r(t={Checkbox_themed:e.theme},e.theme,e.theme),r(t,e.modification,e.modification),t)),onClick:function(){return setTimeout(function(){document.activeElement.blur()},0)}},c.createElement("input",{type:"checkbox",className:a((r(n={Checkbox__input_themed:e.theme,Checkbox__input_themed_indeterminate:e.indeterminate},"".concat(e.theme,"__input"),e.theme),r(n,"".concat(e.theme,"__input_indeterminate"),e.indeterminate),r(n,e.modification,e.modification),n)),disabled:e.disabled,checked:e.value,onChange:e.onChange}),e.theme&&c.createElement("span",{className:a((r(o={Checkbox__image_themed:!0},"".concat(e.theme,"__image"),!0),r(o,e.modification,e.modification),o))}),c.createElement("span",{className:a((r(i={},"".concat(e.theme,"__label"),e.theme),r(i,e.modification,e.modification),i))},e.children))}n.defaultProps={disabled:!1,indeterminate:!1,modification:null,theme:null},e.Checkbox=n,Object.defineProperty(e,"__esModule",{value:!0})});