mirror of
https://github.com/idanoo/GoScrobble.git
synced 2024-11-22 16:35:14 +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.willUnmount();\n }, _this.renderCustomUI = function () {\n var _this$props3 = _this.props,\n title = _this$props3.title,\n message = _this$props3.message,\n buttons = _this$props3.buttons,\n customUI = _this$props3.customUI;\n var dataCustomUI = {\n title: title,\n message: message,\n buttons: buttons,\n onClose: _this.close\n };\n return customUI(dataCustomUI);\n }, _temp), _possibleConstructorReturn(_this, _ret);\n }\n\n _createClass(ReactConfirmAlert, [{\n key: 'render',\n value: function render() {\n var _this2 = this;\n\n var _props = this.props,\n title = _props.title,\n message = _props.message,\n buttons = _props.buttons,\n childrenElement = _props.childrenElement,\n customUI = _props.customUI,\n overlayClassName = _props.overlayClassName;\n return _react2.default.createElement('div', {\n className: 'react-confirm-alert-overlay ' + overlayClassName,\n ref: function ref(dom) {\n return _this2.overlay = dom;\n },\n onClick: this.handleClickOverlay\n }, _react2.default.createElement('div', {\n className: 'react-confirm-alert'\n }, customUI ? this.renderCustomUI() : _react2.default.createElement('div', {\n className: 'react-confirm-alert-body'\n }, title && _react2.default.createElement('h1', null, title), message, childrenElement(), _react2.default.createElement('div', {\n className: 'react-confirm-alert-button-group'\n }, buttons.map(function (button, i) {\n return _react2.default.createElement('button', {\n key: i,\n onClick: function onClick() {\n return _this2.handleClickButton(button);\n },\n className: button.className\n }, button.label);\n })))));\n }\n }]);\n\n return ReactConfirmAlert;\n}(_react.Component), _class.propTypes = {\n title: _propTypes2.default.string,\n message: _propTypes2.default.string,\n buttons: _propTypes2.default.array.isRequired,\n childrenElement: _propTypes2.default.func,\n customUI: _propTypes2.default.func,\n closeOnClickOutside: _propTypes2.default.bool,\n closeOnEscape: _propTypes2.default.bool,\n willUnmount: _propTypes2.default.func,\n afterClose: _propTypes2.default.func,\n onClickOutside: _propTypes2.default.func,\n onKeypressEscape: _propTypes2.default.func,\n overlayClassName: _propTypes2.default.string\n}, _class.defaultProps = {\n buttons: [{\n label: 'Cancel',\n onClick: function onClick() {\n return null;\n },\n className: null\n }, {\n label: 'Confirm',\n onClick: function onClick() {\n return null;\n },\n className: null\n }],\n childrenElement: function childrenElement() {\n return null;\n },\n closeOnClickOutside: true,\n closeOnEscape: true,\n willUnmount: function willUnmount() {\n return null;\n },\n afterClose: function afterClose() {\n return null;\n },\n onClickOutside: function onClickOutside() {\n return null;\n },\n onKeypressEscape: function onKeypressEscape() {\n return null;\n }\n}, _temp2);\nexports.default = ReactConfirmAlert;\n\nfunction createSVGBlurReconfirm() {\n // If has svg ignore to create the svg\n var svg = document.getElementById('react-confirm-alert-firm-svg');\n if (svg) return;\n var svgNS = 'http://www.w3.org/2000/svg';\n var feGaussianBlur = document.createElementNS(svgNS, 'feGaussianBlur');\n feGaussianBlur.setAttribute('stdDeviation', '0.3');\n var filter = document.createElementNS(svgNS, 'filter');\n filter.setAttribute('id', 'gaussian-blur');\n filter.appendChild(feGaussianBlur);\n var svgElem = document.createElementNS(svgNS, 'svg');\n svgElem.setAttribute('id', 'react-confirm-alert-firm-svg');\n svgElem.setAttribute('class', 'react-confirm-alert-svg');\n svgElem.appendChild(filter);\n document.body.appendChild(svgElem);\n}\n\nfunction removeSVGBlurReconfirm(afterClose) {\n var svg = document.getElementById('react-confirm-alert-firm-svg');\n\n if (svg) {\n svg.parentNode.removeChild(svg);\n }\n\n document.body.children[0].classList.remove('react-confirm-alert-blur');\n afterClose();\n}\n\nfunction createElementReconfirm(properties) {\n var divTarget = document.getElementById('react-confirm-alert');\n\n if (divTarget) {\n // Rerender - the mounted ReactConfirmAlert\n (0, _reactDom.render)(_react2.default.createElement(ReactConfirmAlert, properties), divTarget);\n } else {\n // Mount the ReactConfirmAlert component\n document.body.children[0].classList.add('react-confirm-alert-blur');\n divTarget = document.createElement('div');\n divTarget.id = 'react-confirm-alert';\n document.body.appendChild(divTarget);\n (0, _reactDom.render)(_react2.default.createElement(ReactConfirmAlert, properties), divTarget);\n }\n}\n\nfunction removeElementReconfirm() {\n var target = document.getElementById('react-confirm-alert');\n\n if (target) {\n (0, _reactDom.unmountComponentAtNode)(target);\n target.parentNode.removeChild(target);\n }\n}\n\nfunction addBodyClass() {\n document.body.classList.add('react-confirm-alert-body-element');\n}\n\nfunction removeBodyClass() {\n document.body.classList.remove('react-confirm-alert-body-element');\n}\n\nfunction confirmAlert(properties) {\n addBodyClass();\n createSVGBlurReconfirm();\n createElementReconfirm(properties);\n}","map":{"version":3,"sources":["/app/node_modules/react-confirm-alert/lib/index.js"],"names":["Object","defineProperty","exports","value","default","undefined","_createClass","defineProperties","target","props","i","length","descriptor","enumerable","configurable","writable","key","Constructor","protoProps","staticProps","prototype","_class","_temp2","confirmAlert","_react","require","_react2","_interopRequireDefault","_propTypes","_propTypes2","_reactDom","obj","__esModule","_classCallCheck","instance","TypeError","_possibleConstructorReturn","self","call","ReferenceError","_inherits","subClass","superClass","create","constructor","setPrototypeOf","__proto__","ReactConfirmAlert","_Component","_ref","_temp","_this","_ret","_len","arguments","args","Array","_key","getPrototypeOf","apply","concat","handleClickButton","button","onClick","close","handleClickOverlay","e","_this$props","closeOnClickOutside","onClickOutside","isClickOutside","overlay","afterClose","removeBodyClass","removeElementReconfirm","removeSVGBlurReconfirm","keyboardClose","event","_this$props2","closeOnEscape","onKeypressEscape","isKeyCodeEscape","keyCode","componentDidMount","document","addEventListener","componentWillUnmount","removeEventListener","willUnmount","renderCustomUI","_this$props3","title","message","buttons","customUI","dataCustomUI","onClose","render","_this2","_props","childrenElement","overlayClassName","createElement","className","ref","dom","map","label","Component","propTypes","string","array","isRequired","func","bool","defaultProps","createSVGBlurReconfirm","svg","getElementById","svgNS","feGaussianBlur","createElementNS","setAttribute","filter","appendChild","svgElem","body","parentNode","removeChild","children","classList","remove","createElementReconfirm","properties","divTarget","add","id","unmountComponentAtNode","addBodyClass"],"mappings":"AAAA;;AAEAA,MAAM,CAACC,cAAP,CAAsBC,OAAtB,EAA+B,YAA/B,EAA6C;AAC3CC,EAAAA,KAAK,EAAE;AADoC,CAA7C;AAGAD,OAAO,CAACE,OAAR,GAAkBC,SAAlB;;AAEA,IAAIC,YAAY,GAAG,YAAY;AAAE,WAASC,gBAAT,CAA0BC,MAA1B,EAAkCC,KAAlC,EAAyC;AAAE,SAAK,IAAIC,CAAC,GAAG,CAAb,EAAgBA,CAAC,GAAGD,KAAK,CAACE,MAA1B,EAAkCD,CAAC,EAAnC,EAAuC;AAAE,UAAIE,UAAU,GAAGH,KAAK,CAACC,CAAD,CAAtB;AAA2BE,MAAAA,UAAU,CAACC,UAAX,GAAwBD,UAAU,CAACC,UAAX,IAAyB,KAAjD;AAAwDD,MAAAA,UAAU,CAACE,YAAX,GAA0B,IAA1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sB;AACtBgB,EAAAA,sBAAsB,CAACC,UAAD,CAAtB;AACD","sourcesContent":["'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = undefined;\n\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\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) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\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 _this.close();\n }, _this.handleClickOverlay = function (e) {\n var _this$props = _this.props,\n closeOnClickOutside = _this$props.closeOnClickOutside,\n onClickOutside = _this$props.onClickOutside;\n\n var isClickOutside = e.target === _this.overlay;\n\n if (closeOnClickOutside && isClickOutside) {\n onClickOutside();\n _this.close();\n }\n }, _this.close = function () {\n var afterClose = _this.props.afterClose;\n\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\n var isKeyCodeEscape = event.keyCode === 27;\n\n if (closeOnEscape && isKeyCodeEscape) {\n onKeypressEscape(event);\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 _this.props.willUnmount();\n }, _this.renderCustomUI = function () {\n var _this$props3 = _this.props,\n title = _this$props3.title,\n message = _this$props3.message,\n buttons = _this$props3.buttons,\n customUI = _this$props3.customUI;\n\n var dataCustomUI = {\n title: title,\n message: message,\n buttons: buttons,\n onClose: _this.close\n };\n\n return customUI(dataCustomUI);\n }, _temp), _possibleConstructorReturn(_this, _ret);\n }\n\n _createClass(ReactConfirmAlert, [{\n key: 'render',\n value: function render() {\n var _this2 = this;\n\n var _props = this.props,\n title = _props.title,\n message = _props.message,\n buttons = _props.buttons,\n childrenElement = _props.childrenElement,\n customUI = _props.customUI,\n overlayClassName = _props.overlayClassName;\n\n\n return _react2.default.createElement(\n 'div',\n {\n className: 'react-confirm-alert-overlay ' + overlayClassName,\n ref: function ref(dom) {\n return _this2.overlay = dom;\n },\n onClick: this.handleClickOverlay\n },\n _react2.default.createElement(\n 'div',\n { className: 'react-confirm-alert' },\n customUI ? this.renderCustomUI() : _react2.default.createElement(\n 'div',\n { className: 'react-confirm-alert-body' },\n title && _react2.default.createElement(\n 'h1',\n null,\n title\n ),\n message,\n childrenElement(),\n _react2.default.createElement(\n 'div',\n { className: 'react-confirm-alert-button-group' },\n buttons.map(function (button, i) {\n return _react2.default.createElement(\n 'button',\n { key: i, onClick: function onClick() {\n return _this2.handleClickButton(button);\n }, className: button.className },\n button.label\n );\n })\n )\n )\n )\n );\n }\n }]);\n\n return ReactConfirmAlert;\n}(_react.Component), _class.propTypes = {\n title: _propTypes2.default.string,\n message: _propTypes2.default.string,\n buttons: _propTypes2.default.array.isRequired,\n childrenElement: _propTypes2.default.func,\n customUI: _propTypes2.default.func,\n closeOnClickOutside: _propTypes2.default.bool,\n closeOnEscape: _propTypes2.default.bool,\n willUnmount: _propTypes2.default.func,\n afterClose: _propTypes2.default.func,\n onClickOutside: _propTypes2.default.func,\n onKeypressEscape: _propTypes2.default.func,\n overlayClassName: _propTypes2.default.string\n}, _class.defaultProps = {\n buttons: [{\n label: 'Cancel',\n onClick: function onClick() {\n return null;\n },\n className: null\n }, {\n label: 'Confirm',\n onClick: function onClick() {\n return null;\n },\n className: null\n }],\n childrenElement: function childrenElement() {\n return null;\n },\n closeOnClickOutside: true,\n closeOnEscape: true,\n willUnmount: function willUnmount() {\n return null;\n },\n afterClose: function afterClose() {\n return null;\n },\n onClickOutside: function onClickOutside() {\n return null;\n },\n onKeypressEscape: function onKeypressEscape() {\n return null;\n }\n}, _temp2);\nexports.default = ReactConfirmAlert;\n\n\nfunction createSVGBlurReconfirm() {\n // If has svg ignore to create the svg\n var svg = document.getElementById('react-confirm-alert-firm-svg');\n if (svg) return;\n var svgNS = 'http://www.w3.org/2000/svg';\n var feGaussianBlur = document.createElementNS(svgNS, 'feGaussianBlur');\n feGaussianBlur.setAttribute('stdDeviation', '0.3');\n\n var filter = document.createElementNS(svgNS, 'filter');\n filter.setAttribute('id', 'gaussian-blur');\n filter.appendChild(feGaussianBlur);\n\n var svgElem = document.createElementNS(svgNS, 'svg');\n svgElem.setAttribute('id', 'react-confirm-alert-firm-svg');\n svgElem.setAttribute('class', 'react-confirm-alert-svg');\n svgElem.appendChild(filter);\n\n document.body.appendChild(svgElem);\n}\n\nfunction removeSVGBlurReconfirm(afterClose) {\n var svg = document.getElementById('react-confirm-alert-firm-svg');\n if (svg) {\n svg.parentNode.removeChild(svg);\n }\n document.body.children[0].classList.remove('react-confirm-alert-blur');\n afterClose();\n}\n\nfunction createElementReconfirm(properties) {\n var divTarget = document.getElementById('react-confirm-alert');\n if (divTarget) {\n // Rerender - the mounted ReactConfirmAlert\n (0, _reactDom.render)(_react2.default.createElement(ReactConfirmAlert, properties), divTarget);\n } else {\n // Mount the ReactConfirmAlert component\n document.body.children[0].classList.add('react-confirm-alert-blur');\n divTarget = document.createElement('div');\n divTarget.id = 'react-confirm-alert';\n document.body.appendChild(divTarget);\n (0, _reactDom.render)(_react2.default.createElement(ReactConfirmAlert, properties), divTarget);\n }\n}\n\nfunction removeElementReconfirm() {\n var target = document.getElementById('react-confirm-alert');\n if (target) {\n (0, _reactDom.unmountComponentAtNode)(target);\n target.parentNode.removeChild(target);\n }\n}\n\nfunction addBodyClass() {\n document.body.classList.add('react-confirm-alert-body-element');\n}\n\nfunction removeBodyClass() {\n document.body.classList.remove('react-confirm-alert-body-element');\n}\n\nfunction confirmAlert(properties) {\n addBodyClass();\n createSVGBlurReconfirm();\n createElementReconfirm(properties);\n}"]},"metadata":{},"sourceType":"script"} |