1 line
11 KiB
JSON
1 line
11 KiB
JSON
{"ast":null,"code":"import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nvar _excluded = [\"prefixCls\", \"className\", \"style\", \"checked\", \"disabled\", \"defaultChecked\", \"type\", \"title\", \"onChange\"];\nimport classNames from 'classnames';\nimport useMergedState from \"rc-util/es/hooks/useMergedState\";\nimport * as React from 'react';\nimport { forwardRef, useImperativeHandle, useRef } from 'react';\nexport var Checkbox = /*#__PURE__*/forwardRef(function (props, ref) {\n var _props$prefixCls = props.prefixCls,\n prefixCls = _props$prefixCls === void 0 ? 'rc-checkbox' : _props$prefixCls,\n className = props.className,\n style = props.style,\n checked = props.checked,\n disabled = props.disabled,\n _props$defaultChecked = props.defaultChecked,\n defaultChecked = _props$defaultChecked === void 0 ? false : _props$defaultChecked,\n _props$type = props.type,\n type = _props$type === void 0 ? 'checkbox' : _props$type,\n title = props.title,\n onChange = props.onChange,\n inputProps = _objectWithoutProperties(props, _excluded);\n var inputRef = useRef(null);\n var holderRef = useRef(null);\n var _useMergedState = useMergedState(defaultChecked, {\n value: checked\n }),\n _useMergedState2 = _slicedToArray(_useMergedState, 2),\n rawValue = _useMergedState2[0],\n setRawValue = _useMergedState2[1];\n useImperativeHandle(ref, function () {\n return {\n focus: function focus(options) {\n var _inputRef$current;\n (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 || _inputRef$current.focus(options);\n },\n blur: function blur() {\n var _inputRef$current2;\n (_inputRef$current2 = inputRef.current) === null || _inputRef$current2 === void 0 || _inputRef$current2.blur();\n },\n input: inputRef.current,\n nativeElement: holderRef.current\n };\n });\n var classString = classNames(prefixCls, className, _defineProperty(_defineProperty({}, \"\".concat(prefixCls, \"-checked\"), rawValue), \"\".concat(prefixCls, \"-disabled\"), disabled));\n var handleChange = function handleChange(e) {\n if (disabled) {\n return;\n }\n if (!('checked' in props)) {\n setRawValue(e.target.checked);\n }\n onChange === null || onChange === void 0 || onChange({\n target: _objectSpread(_objectSpread({}, props), {}, {\n type: type,\n checked: e.target.checked\n }),\n stopPropagation: function stopPropagation() {\n e.stopPropagation();\n },\n preventDefault: function preventDefault() {\n e.preventDefault();\n },\n nativeEvent: e.nativeEvent\n });\n };\n return /*#__PURE__*/React.createElement(\"span\", {\n className: classString,\n title: title,\n style: style,\n ref: holderRef\n }, /*#__PURE__*/React.createElement(\"input\", _extends({}, inputProps, {\n className: \"\".concat(prefixCls, \"-input\"),\n ref: inputRef,\n onChange: handleChange,\n disabled: disabled,\n checked: !!rawValue,\n type: type\n })), /*#__PURE__*/React.createElement(\"span\", {\n className: \"\".concat(prefixCls, \"-inner\")\n }));\n});\nexport default Checkbox;","map":{"version":3,"names":["_extends","_objectSpread","_defineProperty","_slicedToArray","_objectWithoutProperties","_excluded","classNames","useMergedState","React","forwardRef","useImperativeHandle","useRef","Checkbox","props","ref","_props$prefixCls","prefixCls","className","style","checked","disabled","_props$defaultChecked","defaultChecked","_props$type","type","title","onChange","inputProps","inputRef","holderRef","_useMergedState","value","_useMergedState2","rawValue","setRawValue","focus","options","_inputRef$current","current","blur","_inputRef$current2","input","nativeElement","classString","concat","handleChange","e","target","stopPropagation","preventDefault","nativeEvent","createElement"],"sources":["C:/Users/Аришина)/Desktop/promo/node_modules/rc-checkbox/es/index.js"],"sourcesContent":["import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nvar _excluded = [\"prefixCls\", \"className\", \"style\", \"checked\", \"disabled\", \"defaultChecked\", \"type\", \"title\", \"onChange\"];\nimport classNames from 'classnames';\nimport useMergedState from \"rc-util/es/hooks/useMergedState\";\nimport * as React from 'react';\nimport { forwardRef, useImperativeHandle, useRef } from 'react';\nexport var Checkbox = /*#__PURE__*/forwardRef(function (props, ref) {\n var _props$prefixCls = props.prefixCls,\n prefixCls = _props$prefixCls === void 0 ? 'rc-checkbox' : _props$prefixCls,\n className = props.className,\n style = props.style,\n checked = props.checked,\n disabled = props.disabled,\n _props$defaultChecked = props.defaultChecked,\n defaultChecked = _props$defaultChecked === void 0 ? false : _props$defaultChecked,\n _props$type = props.type,\n type = _props$type === void 0 ? 'checkbox' : _props$type,\n title = props.title,\n onChange = props.onChange,\n inputProps = _objectWithoutProperties(props, _excluded);\n var inputRef = useRef(null);\n var holderRef = useRef(null);\n var _useMergedState = useMergedState(defaultChecked, {\n value: checked\n }),\n _useMergedState2 = _slicedToArray(_useMergedState, 2),\n rawValue = _useMergedState2[0],\n setRawValue = _useMergedState2[1];\n useImperativeHandle(ref, function () {\n return {\n focus: function focus(options) {\n var _inputRef$current;\n (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 || _inputRef$current.focus(options);\n },\n blur: function blur() {\n var _inputRef$current2;\n (_inputRef$current2 = inputRef.current) === null || _inputRef$current2 === void 0 || _inputRef$current2.blur();\n },\n input: inputRef.current,\n nativeElement: holderRef.current\n };\n });\n var classString = classNames(prefixCls, className, _defineProperty(_defineProperty({}, \"\".concat(prefixCls, \"-checked\"), rawValue), \"\".concat(prefixCls, \"-disabled\"), disabled));\n var handleChange = function handleChange(e) {\n if (disabled) {\n return;\n }\n if (!('checked' in props)) {\n setRawValue(e.target.checked);\n }\n onChange === null || onChange === void 0 || onChange({\n target: _objectSpread(_objectSpread({}, props), {}, {\n type: type,\n checked: e.target.checked\n }),\n stopPropagation: function stopPropagation() {\n e.stopPropagation();\n },\n preventDefault: function preventDefault() {\n e.preventDefault();\n },\n nativeEvent: e.nativeEvent\n });\n };\n return /*#__PURE__*/React.createElement(\"span\", {\n className: classString,\n title: title,\n style: style,\n ref: holderRef\n }, /*#__PURE__*/React.createElement(\"input\", _extends({}, inputProps, {\n className: \"\".concat(prefixCls, \"-input\"),\n ref: inputRef,\n onChange: handleChange,\n disabled: disabled,\n checked: !!rawValue,\n type: type\n })), /*#__PURE__*/React.createElement(\"span\", {\n className: \"\".concat(prefixCls, \"-inner\")\n }));\n});\nexport default Checkbox;"],"mappings":"AAAA,OAAOA,QAAQ,MAAM,oCAAoC;AACzD,OAAOC,aAAa,MAAM,0CAA0C;AACpE,OAAOC,eAAe,MAAM,2CAA2C;AACvE,OAAOC,cAAc,MAAM,0CAA0C;AACrE,OAAOC,wBAAwB,MAAM,oDAAoD;AACzF,IAAIC,SAAS,GAAG,CAAC,WAAW,EAAE,WAAW,EAAE,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU,CAAC;AACzH,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,cAAc,MAAM,iCAAiC;AAC5D,OAAO,KAAKC,KAAK,MAAM,OAAO;AAC9B,SAASC,UAAU,EAAEC,mBAAmB,EAAEC,MAAM,QAAQ,OAAO;AAC/D,OAAO,IAAIC,QAAQ,GAAG,aAAaH,UAAU,CAAC,UAAUI,KAAK,EAAEC,GAAG,EAAE;EAClE,IAAIC,gBAAgB,GAAGF,KAAK,CAACG,SAAS;IACpCA,SAAS,GAAGD,gBAAgB,KAAK,KAAK,CAAC,GAAG,aAAa,GAAGA,gBAAgB;IAC1EE,SAAS,GAAGJ,KAAK,CAACI,SAAS;IAC3BC,KAAK,GAAGL,KAAK,CAACK,KAAK;IACnBC,OAAO,GAAGN,KAAK,CAACM,OAAO;IACvBC,QAAQ,GAAGP,KAAK,CAACO,QAAQ;IACzBC,qBAAqB,GAAGR,KAAK,CAACS,cAAc;IAC5CA,cAAc,GAAGD,qBAAqB,KAAK,KAAK,CAAC,GAAG,KAAK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