{"version":3,"sources":["webpack:///./node_modules/rmc-feedback/es/TouchFeedback.js","webpack:///./node_modules/rmc-feedback/es/index.js"],"names":["_React$Component","TouchFeedback","this","_this","__proto__","Object","getPrototypeOf","apply","arguments","state","active","onTouchStart","e","triggerEvent","onTouchMove","onTouchEnd","onTouchCancel","onMouseDown","onMouseUp","onMouseLeave","key","value","props","disabled","setState","type","isActive","ev","eventType","children","_props","activeClassName","activeStyle","events","undefined","child","Children","only","_child$props","style","className","cloneElement","Component","defaultProps"],"mappings":"uNAQI,EAAgB,SAAUA,GAG1B,SAASC,IACL,IAAgBC,KAAMD,GAEtB,IAAIE,EAAQ,IAA2BD,MAAOD,EAAcG,WAAaC,OAAOC,eAAeL,IAAgBM,MAAML,KAAMM,YA2B3H,OAzBAL,EAAMM,MAAQ,CACVC,QAAQ,GAEZP,EAAMQ,aAAe,SAAUC,GAC3BT,EAAMU,aAAa,cAAc,EAAMD,IAE3CT,EAAMW,YAAc,SAAUF,GAC1BT,EAAMU,aAAa,aAAa,EAAOD,IAE3CT,EAAMY,WAAa,SAAUH,GACzBT,EAAMU,aAAa,YAAY,EAAOD,IAE1CT,EAAMa,cAAgB,SAAUJ,GAC5BT,EAAMU,aAAa,eAAe,EAAOD,IAE7CT,EAAMc,YAAc,SAAUL,GAE1BT,EAAMU,aAAa,aAAa,EAAMD,IAE1CT,EAAMe,UAAY,SAAUN,GACxBT,EAAMU,aAAa,WAAW,EAAOD,IAEzCT,EAAMgB,aAAe,SAAUP,GAC3BT,EAAMU,aAAa,cAAc,EAAOD,IAErCT,EAgEX,OAhGA,IAAUF,EAAeD,GAmCzB,IAAaC,EAAe,CAAC,CACzBmB,IAAK,qBACLC,MAAO,WACCnB,KAAKoB,MAAMC,UAAYrB,KAAKO,MAAMC,QAClCR,KAAKsB,SAAS,CACVd,QAAQ,MAIrB,CACCU,IAAK,eACLC,MAAO,SAAsBI,EAAMC,EAAUC,GACzC,IAAIC,EAAY,KAAOH,EACnBI,EAAW3B,KAAKoB,MAAMO,SAEtBA,EAASP,MAAMM,IACfC,EAASP,MAAMM,GAAWD,GAE1BD,IAAaxB,KAAKO,MAAMC,QACxBR,KAAKsB,SAAS,CACVd,OAAQgB,MAIrB,CACCN,IAAK,SACLC,MAAO,WACH,IAAIS,EAAS5B,KAAKoB,MACdO,EAAWC,EAAOD,SAClBN,EAAWO,EAAOP,SAClBQ,EAAkBD,EAAOC,gBACzBC,EAAcF,EAAOE,YAErBC,EAASV,OAAWW,EAAY,CAChCvB,aAAcT,KAAKS,aACnBG,YAAaZ,KAAKY,YAClBC,WAAYb,KAAKa,WACjBC,cAAed,KAAKc,cACpBC,YAAaf,KAAKe,YAClBC,UAAWhB,KAAKgB,UAChBC,aAAcjB,KAAKiB,cAEnBgB,EAAQ,IAAMC,SAASC,KAAKR,GAChC,IAAKN,GAAYrB,KAAKO,MAAMC,OAAQ,CAChC,IAAI4B,EAAeH,EAAMb,MACrBiB,EAAQD,EAAaC,MACrBC,EAAYF,EAAaE,UAQ7B,OANoB,IAAhBR,IACIA,IACAO,EAAQ,IAAS,GAAIA,EAAOP,IAEhCQ,EAAY,IAAWA,EAAWT,IAE/B,IAAMU,aAAaN,EAAO,IAAS,CAAEK,UAAWA,EACnDD,MAAOA,GAASN,IAExB,OAAO,IAAMQ,aAAaN,EAAOF,OAIlChC,EAjGS,CAkGlB,IAAMyC,WAEO,IAEf,EAAcC,aAAe,CACzBpB,UAAU,GC/Gd","file":"npm.rmc-feedback.c920b4ddeb9b68365139.js","sourcesContent":["import _extends from 'babel-runtime/helpers/extends';\nimport _classCallCheck from 'babel-runtime/helpers/classCallCheck';\nimport _createClass from 'babel-runtime/helpers/createClass';\nimport _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructorReturn';\nimport _inherits from 'babel-runtime/helpers/inherits';\nimport React from 'react';\nimport classNames from 'classnames';\n\nvar TouchFeedback = function (_React$Component) {\n _inherits(TouchFeedback, _React$Component);\n\n function TouchFeedback() {\n _classCallCheck(this, TouchFeedback);\n\n var _this = _possibleConstructorReturn(this, (TouchFeedback.__proto__ || Object.getPrototypeOf(TouchFeedback)).apply(this, arguments));\n\n _this.state = {\n active: false\n };\n _this.onTouchStart = function (e) {\n _this.triggerEvent('TouchStart', true, e);\n };\n _this.onTouchMove = function (e) {\n _this.triggerEvent('TouchMove', false, e);\n };\n _this.onTouchEnd = function (e) {\n _this.triggerEvent('TouchEnd', false, e);\n };\n _this.onTouchCancel = function (e) {\n _this.triggerEvent('TouchCancel', false, e);\n };\n _this.onMouseDown = function (e) {\n // pc simulate mobile\n _this.triggerEvent('MouseDown', true, e);\n };\n _this.onMouseUp = function (e) {\n _this.triggerEvent('MouseUp', false, e);\n };\n _this.onMouseLeave = function (e) {\n _this.triggerEvent('MouseLeave', false, e);\n };\n return _this;\n }\n\n _createClass(TouchFeedback, [{\n key: 'componentDidUpdate',\n value: function componentDidUpdate() {\n if (this.props.disabled && this.state.active) {\n this.setState({\n active: false\n });\n }\n }\n }, {\n key: 'triggerEvent',\n value: function triggerEvent(type, isActive, ev) {\n var eventType = 'on' + type;\n var children = this.props.children;\n\n if (children.props[eventType]) {\n children.props[eventType](ev);\n }\n if (isActive !== this.state.active) {\n this.setState({\n active: isActive\n });\n }\n }\n }, {\n key: 'render',\n value: function render() {\n var _props = this.props,\n children = _props.children,\n disabled = _props.disabled,\n activeClassName = _props.activeClassName,\n activeStyle = _props.activeStyle;\n\n var events = disabled ? undefined : {\n onTouchStart: this.onTouchStart,\n onTouchMove: this.onTouchMove,\n onTouchEnd: this.onTouchEnd,\n onTouchCancel: this.onTouchCancel,\n onMouseDown: this.onMouseDown,\n onMouseUp: this.onMouseUp,\n onMouseLeave: this.onMouseLeave\n };\n var child = React.Children.only(children);\n if (!disabled && this.state.active) {\n var _child$props = child.props,\n style = _child$props.style,\n className = _child$props.className;\n\n if (activeStyle !== false) {\n if (activeStyle) {\n style = _extends({}, style, activeStyle);\n }\n className = classNames(className, activeClassName);\n }\n return React.cloneElement(child, _extends({ className: className,\n style: style }, events));\n }\n return React.cloneElement(child, events);\n }\n }]);\n\n return TouchFeedback;\n}(React.Component);\n\nexport default TouchFeedback;\n\nTouchFeedback.defaultProps = {\n disabled: false\n};","export { default } from './TouchFeedback';"],"sourceRoot":""}