173205c3b613b3a77cf29a4f9eca3ed0.json
7.41 KB
{"ast":null,"code":"import _classCallCheck from \"@babel/runtime/helpers/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/createClass\";\nimport _inherits from \"@babel/runtime/helpers/inherits\";\nimport _createSuper from \"@babel/runtime/helpers/createSuper\";\nimport * as React from 'react';\nimport CloseCircleFilled from '@ant-design/icons/CloseCircleFilled';\nimport SearchOutlined from '@ant-design/icons/SearchOutlined';\nimport Input from '../input';\n\nvar Search = /*#__PURE__*/function (_React$Component) {\n _inherits(Search, _React$Component);\n\n var _super = _createSuper(Search);\n\n function Search() {\n var _this;\n\n _classCallCheck(this, Search);\n\n _this = _super.apply(this, arguments);\n\n _this.handleChange = function (e) {\n var onChange = _this.props.onChange;\n\n if (onChange) {\n onChange(e);\n }\n };\n\n _this.handleClear = function (e) {\n e.preventDefault();\n var _this$props = _this.props,\n handleClear = _this$props.handleClear,\n disabled = _this$props.disabled;\n\n if (!disabled && handleClear) {\n handleClear(e);\n }\n };\n\n return _this;\n }\n\n _createClass(Search, [{\n key: \"render\",\n value: function render() {\n var _this$props2 = this.props,\n placeholder = _this$props2.placeholder,\n value = _this$props2.value,\n prefixCls = _this$props2.prefixCls,\n disabled = _this$props2.disabled;\n var icon = value && value.length > 0 ? /*#__PURE__*/React.createElement(\"a\", {\n className: \"\".concat(prefixCls, \"-action\"),\n onClick: this.handleClear\n }, /*#__PURE__*/React.createElement(CloseCircleFilled, null)) : /*#__PURE__*/React.createElement(\"span\", {\n className: \"\".concat(prefixCls, \"-action\")\n }, /*#__PURE__*/React.createElement(SearchOutlined, null));\n return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Input, {\n placeholder: placeholder,\n className: prefixCls,\n value: value,\n onChange: this.handleChange,\n disabled: disabled\n }), icon);\n }\n }]);\n\n return Search;\n}(React.Component);\n\nexport { Search as default };\nSearch.defaultProps = {\n placeholder: ''\n};","map":{"version":3,"sources":["C:/Users/kkwan_000/Desktop/git/2017110269/minsung/node_modules/antd/es/transfer/search.js"],"names":["_classCallCheck","_createClass","_inherits","_createSuper","React","CloseCircleFilled","SearchOutlined","Input","Search","_React$Component","_super","_this","apply","arguments","handleChange","e","onChange","props","handleClear","preventDefault","_this$props","disabled","key","value","render","_this$props2","placeholder","prefixCls","icon","length","createElement","className","concat","onClick","Fragment","Component","default","defaultProps"],"mappings":"AAAA,OAAOA,eAAP,MAA4B,uCAA5B;AACA,OAAOC,YAAP,MAAyB,oCAAzB;AACA,OAAOC,SAAP,MAAsB,iCAAtB;AACA,OAAOC,YAAP,MAAyB,oCAAzB;AACA,OAAO,KAAKC,KAAZ,MAAuB,OAAvB;AACA,OAAOC,iBAAP,MAA8B,qCAA9B;AACA,OAAOC,cAAP,MAA2B,kCAA3B;AACA,OAAOC,KAAP,MAAkB,UAAlB;;AAEA,IAAIC,MAAM,GAAG,aAAa,UAAUC,gBAAV,EAA4B;AACpDP,EAAAA,SAAS,CAACM,MAAD,EAASC,gBAAT,CAAT;;AAEA,MAAIC,MAAM,GAAGP,YAAY,CAACK,MAAD,CAAzB;;AAEA,WAASA,MAAT,GAAkB;AAChB,QAAIG,KAAJ;;AAEAX,IAAAA,eAAe,CAAC,IAAD,EAAOQ,MAAP,CAAf;;AAEAG,IAAAA,KAAK,GAAGD,MAAM,CAACE,KAAP,CAAa,IAAb,EAAmBC,SAAnB,CAAR;;AAEAF,IAAAA,KAAK,CAACG,YAAN,GAAqB,UAAUC,CAAV,EAAa;AAChC,UAAIC,QAAQ,GAAGL,KAAK,CAACM,KAAN,CAAYD,QAA3B;;AAEA,UAAIA,QAAJ,EAAc;AACZA,QAAAA,QAAQ,CAACD,CAAD,CAAR;AACD;AACF,KAND;;AAQAJ,IAAAA,KAAK,CAACO,WAAN,GAAoB,UAAUH,CAAV,EAAa;AAC/BA,MAAAA,CAAC,CAACI,cAAF;AACA,UAAIC,WAAW,GAAGT,KAAK,CAACM,KAAxB;AAAA,UACIC,WAAW,GAAGE,WAAW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AAAA,WAAW,EAAEA,WADuF;AAEpGK,QAAAA,SAAS,EAAEJ,SAFyF;AAGpGJ,QAAAA,KAAK,EAAEA,KAH6F;AAIpGP,QAAAA,QAAQ,EAAE,KAAKF,YAJqF;AAKpGO,QAAAA,QAAQ,EAAEA;AAL0F,OAA3B,CAAvD,EAMhBO,IANgB,CAApB;AAOD;AArBmB,GAAD,CAAT,CAAZ;;AAwBA,SAAOpB,MAAP;AACD,CA3DyB,CA2DxBJ,KAAK,CAAC+B,SA3DkB,CAA1B;;AA6DA,SAAS3B,MAAM,IAAI4B,OAAnB;AACA5B,MAAM,CAAC6B,YAAP,GAAsB;AACpBX,EAAAA,WAAW,EAAE;AADO,CAAtB","sourcesContent":["import _classCallCheck from \"@babel/runtime/helpers/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/createClass\";\nimport _inherits from \"@babel/runtime/helpers/inherits\";\nimport _createSuper from \"@babel/runtime/helpers/createSuper\";\nimport * as React from 'react';\nimport CloseCircleFilled from '@ant-design/icons/CloseCircleFilled';\nimport SearchOutlined from '@ant-design/icons/SearchOutlined';\nimport Input from '../input';\n\nvar Search = /*#__PURE__*/function (_React$Component) {\n _inherits(Search, _React$Component);\n\n var _super = _createSuper(Search);\n\n function Search() {\n var _this;\n\n _classCallCheck(this, Search);\n\n _this = _super.apply(this, arguments);\n\n _this.handleChange = function (e) {\n var onChange = _this.props.onChange;\n\n if (onChange) {\n onChange(e);\n }\n };\n\n _this.handleClear = function (e) {\n e.preventDefault();\n var _this$props = _this.props,\n handleClear = _this$props.handleClear,\n disabled = _this$props.disabled;\n\n if (!disabled && handleClear) {\n handleClear(e);\n }\n };\n\n return _this;\n }\n\n _createClass(Search, [{\n key: \"render\",\n value: function render() {\n var _this$props2 = this.props,\n placeholder = _this$props2.placeholder,\n value = _this$props2.value,\n prefixCls = _this$props2.prefixCls,\n disabled = _this$props2.disabled;\n var icon = value && value.length > 0 ? /*#__PURE__*/React.createElement(\"a\", {\n className: \"\".concat(prefixCls, \"-action\"),\n onClick: this.handleClear\n }, /*#__PURE__*/React.createElement(CloseCircleFilled, null)) : /*#__PURE__*/React.createElement(\"span\", {\n className: \"\".concat(prefixCls, \"-action\")\n }, /*#__PURE__*/React.createElement(SearchOutlined, null));\n return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Input, {\n placeholder: placeholder,\n className: prefixCls,\n value: value,\n onChange: this.handleChange,\n disabled: disabled\n }), icon);\n }\n }]);\n\n return Search;\n}(React.Component);\n\nexport { Search as default };\nSearch.defaultProps = {\n placeholder: ''\n};"]},"metadata":{},"sourceType":"module"}