e36be4f76265b3f3d19950d7fd29fd0c.json 11.5 KB
{"ast":null,"code":"import _classCallCheck from \"@babel/runtime/helpers/esm/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/esm/createClass\";\nimport _inherits from \"@babel/runtime/helpers/esm/inherits\";\nimport _possibleConstructorReturn from \"@babel/runtime/helpers/esm/possibleConstructorReturn\";\nimport _getPrototypeOf from \"@babel/runtime/helpers/esm/getPrototypeOf\";\n\nfunction _createSuper(Derived) {\n  var hasNativeReflectConstruct = _isNativeReflectConstruct();\n\n  return function _createSuperInternal() {\n    var Super = _getPrototypeOf(Derived),\n        result;\n\n    if (hasNativeReflectConstruct) {\n      var NewTarget = _getPrototypeOf(this).constructor;\n\n      result = Reflect.construct(Super, arguments, NewTarget);\n    } else {\n      result = Super.apply(this, arguments);\n    }\n\n    return _possibleConstructorReturn(this, result);\n  };\n}\n\nfunction _isNativeReflectConstruct() {\n  if (typeof Reflect === \"undefined\" || !Reflect.construct) return false;\n  if (Reflect.construct.sham) return false;\n  if (typeof Proxy === \"function\") return true;\n\n  try {\n    Date.prototype.toString.call(Reflect.construct(Date, [], function () {}));\n    return true;\n  } catch (e) {\n    return false;\n  }\n}\n\nimport * as React from 'react';\nimport ResizableTextArea from './ResizableTextArea';\n\nvar TextArea = /*#__PURE__*/function (_React$Component) {\n  _inherits(TextArea, _React$Component);\n\n  var _super = _createSuper(TextArea);\n\n  function TextArea(props) {\n    var _this;\n\n    _classCallCheck(this, TextArea);\n\n    _this = _super.call(this, props);\n\n    _this.focus = function () {\n      _this.resizableTextArea.textArea.focus();\n    };\n\n    _this.saveTextArea = function (resizableTextArea) {\n      _this.resizableTextArea = resizableTextArea;\n    };\n\n    _this.handleChange = function (e) {\n      var onChange = _this.props.onChange;\n\n      _this.setValue(e.target.value, function () {\n        _this.resizableTextArea.resizeTextarea();\n      });\n\n      if (onChange) {\n        onChange(e);\n      }\n    };\n\n    _this.handleKeyDown = function (e) {\n      var _this$props = _this.props,\n          onPressEnter = _this$props.onPressEnter,\n          onKeyDown = _this$props.onKeyDown;\n\n      if (e.keyCode === 13 && onPressEnter) {\n        onPressEnter(e);\n      }\n\n      if (onKeyDown) {\n        onKeyDown(e);\n      }\n    };\n\n    var value = typeof props.value === 'undefined' || props.value === null ? props.defaultValue : props.value;\n    _this.state = {\n      value: value\n    };\n    return _this;\n  }\n\n  _createClass(TextArea, [{\n    key: \"setValue\",\n    value: function setValue(value, callback) {\n      if (!('value' in this.props)) {\n        this.setState({\n          value: value\n        }, callback);\n      }\n    }\n  }, {\n    key: \"blur\",\n    value: function blur() {\n      this.resizableTextArea.textArea.blur();\n    }\n  }, {\n    key: \"render\",\n    value: function render() {\n      return React.createElement(ResizableTextArea, Object.assign({}, this.props, {\n        value: this.state.value,\n        onKeyDown: this.handleKeyDown,\n        onChange: this.handleChange,\n        ref: this.saveTextArea\n      }));\n    }\n  }], [{\n    key: \"getDerivedStateFromProps\",\n    value: function getDerivedStateFromProps(nextProps) {\n      if ('value' in nextProps) {\n        return {\n          value: nextProps.value\n        };\n      }\n\n      return null;\n    }\n  }]);\n\n  return TextArea;\n}(React.Component);\n\nexport { ResizableTextArea };\nexport default TextArea;","map":{"version":3,"sources":["C:/Users/kkwan_000/Desktop/git/2017110269/minsung/node_modules/rc-textarea/es/index.js"],"names":["_classCallCheck","_createClass","_inherits","_possibleConstructorReturn","_getPrototypeOf","_createSuper","Derived","hasNativeReflectConstruct","_isNativeReflectConstruct","_createSuperInternal","Super","result","NewTarget","constructor","Reflect","construct","arguments","apply","sham","Proxy","Date","prototype","toString","call","e","React","ResizableTextArea","TextArea","_React$Component","_super","props","_this","focus","resizableTextArea","textArea","saveTextArea","handleChange","onChange","setValue","target","value","resizeTextarea","handleKeyDown","_this$props","onPressEnter","onKeyDown","keyCode","defaultValue","state","key","callback","setState","blur","render","createElement","Object","assign","ref","getDerivedStateFromProps","nextProps","Component"],"mappings":"AAAA,OAAOA,eAAP,MAA4B,2CAA5B;AACA,OAAOC,YAAP,MAAyB,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,YAH2D;AAI1EqB,QAAAA,GAAG,EAAE,KAAKtB;AAJgE,OAA9B,CAAvC,CAAP;AAMD;AATA,GAdoB,CAAX,EAwBR,CAAC;AACHc,IAAAA,GAAG,EAAE,0BADF;AAEHT,IAAAA,KAAK,EAAE,SAASkB,wBAAT,CAAkCC,SAAlC,EAA6C;AAClD,UAAI,WAAWA,SAAf,EAA0B;AACxB,eAAO;AACLnB,UAAAA,KAAK,EAAEmB,SAAS,CAACnB;AADZ,SAAP;AAGD;;AAED,aAAO,IAAP;AACD;AAVE,GAAD,CAxBQ,CAAZ;;AAqCA,SAAOb,QAAP;AACD,CA3F2B,CA2F1BF,KAAK,CAACmC,SA3FoB,CAA5B;;AA6FA,SAASlC,iBAAT;AACA,eAAeC,QAAf","sourcesContent":["import _classCallCheck from \"@babel/runtime/helpers/esm/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/esm/createClass\";\nimport _inherits from \"@babel/runtime/helpers/esm/inherits\";\nimport _possibleConstructorReturn from \"@babel/runtime/helpers/esm/possibleConstructorReturn\";\nimport _getPrototypeOf from \"@babel/runtime/helpers/esm/getPrototypeOf\";\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\nimport * as React from 'react';\nimport ResizableTextArea from './ResizableTextArea';\n\nvar TextArea = /*#__PURE__*/function (_React$Component) {\n  _inherits(TextArea, _React$Component);\n\n  var _super = _createSuper(TextArea);\n\n  function TextArea(props) {\n    var _this;\n\n    _classCallCheck(this, TextArea);\n\n    _this = _super.call(this, props);\n\n    _this.focus = function () {\n      _this.resizableTextArea.textArea.focus();\n    };\n\n    _this.saveTextArea = function (resizableTextArea) {\n      _this.resizableTextArea = resizableTextArea;\n    };\n\n    _this.handleChange = function (e) {\n      var onChange = _this.props.onChange;\n\n      _this.setValue(e.target.value, function () {\n        _this.resizableTextArea.resizeTextarea();\n      });\n\n      if (onChange) {\n        onChange(e);\n      }\n    };\n\n    _this.handleKeyDown = function (e) {\n      var _this$props = _this.props,\n          onPressEnter = _this$props.onPressEnter,\n          onKeyDown = _this$props.onKeyDown;\n\n      if (e.keyCode === 13 && onPressEnter) {\n        onPressEnter(e);\n      }\n\n      if (onKeyDown) {\n        onKeyDown(e);\n      }\n    };\n\n    var value = typeof props.value === 'undefined' || props.value === null ? props.defaultValue : props.value;\n    _this.state = {\n      value: value\n    };\n    return _this;\n  }\n\n  _createClass(TextArea, [{\n    key: \"setValue\",\n    value: function setValue(value, callback) {\n      if (!('value' in this.props)) {\n        this.setState({\n          value: value\n        }, callback);\n      }\n    }\n  }, {\n    key: \"blur\",\n    value: function blur() {\n      this.resizableTextArea.textArea.blur();\n    }\n  }, {\n    key: \"render\",\n    value: function render() {\n      return React.createElement(ResizableTextArea, Object.assign({}, this.props, {\n        value: this.state.value,\n        onKeyDown: this.handleKeyDown,\n        onChange: this.handleChange,\n        ref: this.saveTextArea\n      }));\n    }\n  }], [{\n    key: \"getDerivedStateFromProps\",\n    value: function getDerivedStateFromProps(nextProps) {\n      if ('value' in nextProps) {\n        return {\n          value: nextProps.value\n        };\n      }\n\n      return null;\n    }\n  }]);\n\n  return TextArea;\n}(React.Component);\n\nexport { ResizableTextArea };\nexport default TextArea;"]},"metadata":{},"sourceType":"module"}