7ee63c9bd28cf187e693a9205ce6c93f.json
14.1 KB
{"ast":null,"code":"import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport _extends from \"@babel/runtime/helpers/extends\";\n\nvar __rest = this && this.__rest || function (s, e) {\n var t = {};\n\n for (var p in s) {\n if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];\n }\n\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];\n }\n return t;\n};\n\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport RcCheckbox from 'rc-checkbox';\nimport { GroupContext } from './Group';\nimport { ConfigContext } from '../config-provider';\nimport devWarning from '../_util/devWarning';\n\nvar InternalCheckbox = function InternalCheckbox(_a, ref) {\n var _classNames;\n\n var customizePrefixCls = _a.prefixCls,\n className = _a.className,\n children = _a.children,\n _a$indeterminate = _a.indeterminate,\n indeterminate = _a$indeterminate === void 0 ? false : _a$indeterminate,\n style = _a.style,\n onMouseEnter = _a.onMouseEnter,\n onMouseLeave = _a.onMouseLeave,\n restProps = __rest(_a, [\"prefixCls\", \"className\", \"children\", \"indeterminate\", \"style\", \"onMouseEnter\", \"onMouseLeave\"]);\n\n var _React$useContext = React.useContext(ConfigContext),\n getPrefixCls = _React$useContext.getPrefixCls,\n direction = _React$useContext.direction;\n\n var checkboxGroup = React.useContext(GroupContext);\n var prevValue = React.useRef(restProps.value);\n React.useEffect(function () {\n checkboxGroup === null || checkboxGroup === void 0 ? void 0 : checkboxGroup.registerValue(restProps.value);\n devWarning('checked' in restProps || !!checkboxGroup || !('value' in restProps), 'Checkbox', '`value` is not a valid prop, do you mean `checked`?');\n }, []);\n React.useEffect(function () {\n if (restProps.value !== prevValue.current) {\n checkboxGroup === null || checkboxGroup === void 0 ? void 0 : checkboxGroup.cancelValue(prevValue.current);\n checkboxGroup === null || checkboxGroup === void 0 ? void 0 : checkboxGroup.registerValue(restProps.value);\n }\n\n return function () {\n return checkboxGroup === null || checkboxGroup === void 0 ? void 0 : checkboxGroup.cancelValue(restProps.value);\n };\n }, [restProps.value]);\n var prefixCls = getPrefixCls('checkbox', customizePrefixCls);\n\n var checkboxProps = _extends({}, restProps);\n\n if (checkboxGroup) {\n checkboxProps.onChange = function () {\n if (restProps.onChange) {\n restProps.onChange.apply(restProps, arguments);\n }\n\n if (checkboxGroup.toggleOption) {\n checkboxGroup.toggleOption({\n label: children,\n value: restProps.value\n });\n }\n };\n\n checkboxProps.name = checkboxGroup.name;\n checkboxProps.checked = checkboxGroup.value.indexOf(restProps.value) !== -1;\n checkboxProps.disabled = restProps.disabled || checkboxGroup.disabled;\n }\n\n var classString = classNames((_classNames = {}, _defineProperty(_classNames, \"\".concat(prefixCls, \"-wrapper\"), true), _defineProperty(_classNames, \"\".concat(prefixCls, \"-rtl\"), direction === 'rtl'), _defineProperty(_classNames, \"\".concat(prefixCls, \"-wrapper-checked\"), checkboxProps.checked), _defineProperty(_classNames, \"\".concat(prefixCls, \"-wrapper-disabled\"), checkboxProps.disabled), _classNames), className);\n var checkboxClass = classNames(_defineProperty({}, \"\".concat(prefixCls, \"-indeterminate\"), indeterminate));\n return (\n /*#__PURE__*/\n // eslint-disable-next-line jsx-a11y/label-has-associated-control\n React.createElement(\"label\", {\n className: classString,\n style: style,\n onMouseEnter: onMouseEnter,\n onMouseLeave: onMouseLeave\n }, /*#__PURE__*/React.createElement(RcCheckbox, _extends({}, checkboxProps, {\n prefixCls: prefixCls,\n className: checkboxClass,\n ref: ref\n })), children !== undefined && /*#__PURE__*/React.createElement(\"span\", null, children))\n );\n};\n\nvar Checkbox = /*#__PURE__*/React.forwardRef(InternalCheckbox);\nCheckbox.displayName = 'Checkbox';\nexport default Checkbox;","map":{"version":3,"sources":["C:/Users/kkwan_000/Desktop/git/2017110269/minsung/node_modules/antd/es/checkbox/Checkbox.js"],"names":["_defineProperty","_extends","__rest","s","e","t","p","Object","prototype","hasOwnProperty","call","indexOf","getOwnPropertySymbols","i","length","propertyIsEnumerable","React","classNames","RcCheckbox","GroupContext","ConfigContext","devWarning","InternalCheckbox","_a","ref","_classNames","customizePrefixCls","prefixCls","className","children","_a$indeterminate","indeterminate","style","onMouseEnter","onMouseLeave","restProps","_React$useContext","useContext","getPrefixCls","direction","checkboxGroup","prevValue","useRef","value","useEffect","registerValue","current","cancelValue","checkboxProps","onChange","apply","arguments","toggleOption","label","name","checked","disabled","classString","concat","checkboxClass","createElement","undefined","Checkbox","forwardRef","displayName"],"mappings":"AAAA,OAAOA,eAAP,MAA4B,uCAA5B;AACA,OAAOC,QAAP,MAAqB,gCAArB;;AAEA,IAAIC,MAAM,GAAG,QAAQ,KAAKA,MAAb,IAAuB,UAAUC,CAAV,EAAaC,CAAb,EAAgB;AAClD,MAAIC,CAAC,GAAG,EAAR;;AAEA,OAAK,IAAIC,CAAT,IAAcH,CAAd,EAAiB;AACf,QAAII,MAAM,CAACC,SAAP,CAAiBC,cAAjB,CAAgCC,IAAhC,CAAqCP,CAArC,EAAwCG,CAAxC,KAA8CF,CAAC,CAACO,OAAF,CAAUL,CAAV,IAAe,CAAjE,EAAoED,CAAC,CAACC,CAAD,CAAD,GAAOH,CAAC,CAACG,CAAD,CAAR;AACrE;;AAED,MAAIH,CAAC,IAAI,IAAL,IAAa,OAAOI,MAAM,CAACK,qBAAd,KAAwC,UAAzD,EAAqE,KAAK,IAAIC,CAAC,GAAG,CAAR,EAAWP,CAAC,GAAGC,MAAM,CAACK,qBAAP,CAA6BT,CAA7B,CAApB,EAAqDU,CAAC,GAAGP,CAAC,CAACQ,MAA3D,EAAmED,CAAC,EAApE,EAAwE;AAC3I,QAAIT,CAAC,CAACO,OAAF,CAAUL,CAAC,CAACO,CAAD,CAAX,IAAkB,CAAlB,IAAuBN,MAAM,CAACC,SAAP,CAAiBO,oBAAjB,CAAsCL,IAAtC,CAA2CP,C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,QAAvE,CAAvR,EAAyW/B,WAA3W,GAAyXG,SAAzX,CAA5B;AACA,MAAI+B,aAAa,GAAG1C,UAAU,CAACjB,eAAe,CAAC,EAAD,EAAK,GAAG0D,MAAH,CAAU/B,SAAV,EAAqB,gBAArB,CAAL,EAA6CI,aAA7C,CAAhB,CAA9B;AACA;AACE;AACA;AACAf,IAAAA,KAAK,CAAC4C,aAAN,CAAoB,OAApB,EAA6B;AAC3BhC,MAAAA,SAAS,EAAE6B,WADgB;AAE3BzB,MAAAA,KAAK,EAAEA,KAFoB;AAG3BC,MAAAA,YAAY,EAAEA,YAHa;AAI3BC,MAAAA,YAAY,EAAEA;AAJa,KAA7B,EAKG,aAAalB,KAAK,CAAC4C,aAAN,CAAoB1C,UAApB,EAAgCjB,QAAQ,CAAC,EAAD,EAAK+C,aAAL,EAAoB;AAC1ErB,MAAAA,SAAS,EAAEA,SAD+D;AAE1EC,MAAAA,SAAS,EAAE+B,aAF+D;AAG1EnC,MAAAA,GAAG,EAAEA;AAHqE,KAApB,CAAxC,CALhB,EASKK,QAAQ,KAAKgC,SAAb,IAA0B,aAAa7C,KAAK,CAAC4C,aAAN,CAAoB,MAApB,EAA4B,IAA5B,EAAkC/B,QAAlC,CAT5C;AAHF;AAcD,CAxED;;AA0EA,IAAIiC,QAAQ,GAAG,aAAa9C,KAAK,CAAC+C,UAAN,CAAiBzC,gBAAjB,CAA5B;AACAwC,QAAQ,CAACE,WAAT,GAAuB,UAAvB;AACA,eAAeF,QAAf","sourcesContent":["import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport _extends from \"@babel/runtime/helpers/extends\";\n\nvar __rest = this && this.__rest || function (s, e) {\n var t = {};\n\n for (var p in s) {\n if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];\n }\n\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];\n }\n return t;\n};\n\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport RcCheckbox from 'rc-checkbox';\nimport { GroupContext } from './Group';\nimport { ConfigContext } from '../config-provider';\nimport devWarning from '../_util/devWarning';\n\nvar InternalCheckbox = function InternalCheckbox(_a, ref) {\n var _classNames;\n\n var customizePrefixCls = _a.prefixCls,\n className = _a.className,\n children = _a.children,\n _a$indeterminate = _a.indeterminate,\n indeterminate = _a$indeterminate === void 0 ? false : _a$indeterminate,\n style = _a.style,\n onMouseEnter = _a.onMouseEnter,\n onMouseLeave = _a.onMouseLeave,\n restProps = __rest(_a, [\"prefixCls\", \"className\", \"children\", \"indeterminate\", \"style\", \"onMouseEnter\", \"onMouseLeave\"]);\n\n var _React$useContext = React.useContext(ConfigContext),\n getPrefixCls = _React$useContext.getPrefixCls,\n direction = _React$useContext.direction;\n\n var checkboxGroup = React.useContext(GroupContext);\n var prevValue = React.useRef(restProps.value);\n React.useEffect(function () {\n checkboxGroup === null || checkboxGroup === void 0 ? void 0 : checkboxGroup.registerValue(restProps.value);\n devWarning('checked' in restProps || !!checkboxGroup || !('value' in restProps), 'Checkbox', '`value` is not a valid prop, do you mean `checked`?');\n }, []);\n React.useEffect(function () {\n if (restProps.value !== prevValue.current) {\n checkboxGroup === null || checkboxGroup === void 0 ? void 0 : checkboxGroup.cancelValue(prevValue.current);\n checkboxGroup === null || checkboxGroup === void 0 ? void 0 : checkboxGroup.registerValue(restProps.value);\n }\n\n return function () {\n return checkboxGroup === null || checkboxGroup === void 0 ? void 0 : checkboxGroup.cancelValue(restProps.value);\n };\n }, [restProps.value]);\n var prefixCls = getPrefixCls('checkbox', customizePrefixCls);\n\n var checkboxProps = _extends({}, restProps);\n\n if (checkboxGroup) {\n checkboxProps.onChange = function () {\n if (restProps.onChange) {\n restProps.onChange.apply(restProps, arguments);\n }\n\n if (checkboxGroup.toggleOption) {\n checkboxGroup.toggleOption({\n label: children,\n value: restProps.value\n });\n }\n };\n\n checkboxProps.name = checkboxGroup.name;\n checkboxProps.checked = checkboxGroup.value.indexOf(restProps.value) !== -1;\n checkboxProps.disabled = restProps.disabled || checkboxGroup.disabled;\n }\n\n var classString = classNames((_classNames = {}, _defineProperty(_classNames, \"\".concat(prefixCls, \"-wrapper\"), true), _defineProperty(_classNames, \"\".concat(prefixCls, \"-rtl\"), direction === 'rtl'), _defineProperty(_classNames, \"\".concat(prefixCls, \"-wrapper-checked\"), checkboxProps.checked), _defineProperty(_classNames, \"\".concat(prefixCls, \"-wrapper-disabled\"), checkboxProps.disabled), _classNames), className);\n var checkboxClass = classNames(_defineProperty({}, \"\".concat(prefixCls, \"-indeterminate\"), indeterminate));\n return (\n /*#__PURE__*/\n // eslint-disable-next-line jsx-a11y/label-has-associated-control\n React.createElement(\"label\", {\n className: classString,\n style: style,\n onMouseEnter: onMouseEnter,\n onMouseLeave: onMouseLeave\n }, /*#__PURE__*/React.createElement(RcCheckbox, _extends({}, checkboxProps, {\n prefixCls: prefixCls,\n className: checkboxClass,\n ref: ref\n })), children !== undefined && /*#__PURE__*/React.createElement(\"span\", null, children))\n );\n};\n\nvar Checkbox = /*#__PURE__*/React.forwardRef(InternalCheckbox);\nCheckbox.displayName = 'Checkbox';\nexport default Checkbox;"]},"metadata":{},"sourceType":"module"}