mirror of
https://github.com/idanoo/GoScrobble.git
synced 2024-11-25 09:55:15 +00:00
1 line
30 KiB
JSON
1 line
30 KiB
JSON
|
{"ast":null,"code":"'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = undefined;\n\nvar _createClass = function () {\n function defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n\n return function (Constructor, protoProps, staticProps) {\n if (protoProps) defineProperties(Constructor.prototype, protoProps);\n if (staticProps) defineProperties(Constructor, staticProps);\n return Constructor;\n };\n}();\n\nvar _class, _temp2;\n\nexports.confirmAlert = confirmAlert;\n\nvar _react = require('react');\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _propTypes = require('prop-types');\n\nvar _propTypes2 = _interopRequireDefault(_propTypes);\n\nvar _reactDom = require('react-dom');\n\nfunction _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n}\n\nfunction _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nfunction _possibleConstructorReturn(self, call) {\n if (!self) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self;\n}\n\nfunction _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass);\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;\n}\n\nvar ReactConfirmAlert = (_temp2 = _class = function (_Component) {\n _inherits(ReactConfirmAlert, _Component);\n\n function ReactConfirmAlert() {\n var _ref;\n\n var _temp, _this, _ret;\n\n _classCallCheck(this, ReactConfirmAlert);\n\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = ReactConfirmAlert.__proto__ || Object.getPrototypeOf(ReactConfirmAlert)).call.apply(_ref, [this].concat(args))), _this), _this.handleClickButton = function (button) {\n if (button.onClick) button.onClick();\n\n _this.close();\n }, _this.handleClickOverlay = function (e) {\n var _this$props = _this.props,\n closeOnClickOutside = _this$props.closeOnClickOutside,\n onClickOutside = _this$props.onClickOutside;\n var isClickOutside = e.target === _this.overlay;\n\n if (closeOnClickOutside && isClickOutside) {\n onClickOutside();\n\n _this.close();\n }\n }, _this.close = function () {\n var afterClose = _this.props.afterClose;\n removeBodyClass();\n removeElementReconfirm();\n removeSVGBlurReconfirm(afterClose);\n }, _this.keyboardClose = function (event) {\n var _this$props2 = _this.props,\n closeOnEscape = _this$props2.closeOnEscape,\n onKeypressEscape = _this$props2.onKeypressEscape;\n var isKeyCodeEscape = event.keyCode === 27;\n\n if (closeOnEscape && isKeyCodeEscape) {\n onKeypressEscape(event);\n\n _this.close();\n }\n }, _this.componentDidMount = function () {\n document.addEventListener('keydown', _this.keyboardClose, false);\n }, _this.componentWillUnmount = function () {\n document.removeEventListener('keydown', _this.keyboardClose, false);\n\n _this.props.willU
|