mirror of
https://github.com/idanoo/GoScrobble.git
synced 2024-11-24 09:25:15 +00:00
1 line
7.2 KiB
JSON
1 line
7.2 KiB
JSON
{"ast":null,"code":"import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _assertThisInitialized from \"@babel/runtime/helpers/esm/assertThisInitialized\";\nimport _inheritsLoose from \"@babel/runtime/helpers/esm/inheritsLoose\";\nimport React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport Collapse from './Collapse';\nimport { omit, findDOMElements, defaultToggleEvents, addMultipleEventListeners } from './utils';\nvar omitKeys = ['toggleEvents', 'defaultOpen'];\nvar propTypes = {\n defaultOpen: PropTypes.bool,\n toggler: PropTypes.string.isRequired,\n toggleEvents: PropTypes.arrayOf(PropTypes.string)\n};\nvar defaultProps = {\n toggleEvents: defaultToggleEvents\n};\n\nvar UncontrolledCollapse = /*#__PURE__*/function (_Component) {\n _inheritsLoose(UncontrolledCollapse, _Component);\n\n function UncontrolledCollapse(props) {\n var _this;\n\n _this = _Component.call(this, props) || this;\n _this.togglers = null;\n _this.removeEventListeners = null;\n _this.toggle = _this.toggle.bind(_assertThisInitialized(_this));\n _this.state = {\n isOpen: props.defaultOpen || false\n };\n return _this;\n }\n\n var _proto = UncontrolledCollapse.prototype;\n\n _proto.componentDidMount = function componentDidMount() {\n this.togglers = findDOMElements(this.props.toggler);\n\n if (this.togglers.length) {\n this.removeEventListeners = addMultipleEventListeners(this.togglers, this.toggle, this.props.toggleEvents);\n }\n };\n\n _proto.componentWillUnmount = function componentWillUnmount() {\n if (this.togglers.length && this.removeEventListeners) {\n this.removeEventListeners();\n }\n };\n\n _proto.toggle = function toggle(e) {\n this.setState(function (_ref) {\n var isOpen = _ref.isOpen;\n return {\n isOpen: !isOpen\n };\n });\n e.preventDefault();\n };\n\n _proto.render = function render() {\n return /*#__PURE__*/React.createElement(Collapse, _extends({\n isOpen: this.state.isOpen\n }, omit(this.props, omitKeys)));\n };\n\n return UncontrolledCollapse;\n}(Component);\n\nUncontrolledCollapse.propTypes = propTypes;\nUncontrolledCollapse.defaultProps = defaultProps;\nexport default UncontrolledCollapse;","map":{"version":3,"sources":["/app/node_modules/reactstrap/es/UncontrolledCollapse.js"],"names":["_extends","_assertThisInitialized","_inheritsLoose","React","Component","PropTypes","Collapse","omit","findDOMElements","defaultToggleEvents","addMultipleEventListeners","omitKeys","propTypes","defaultOpen","bool","toggler","string","isRequired","toggleEvents","arrayOf","defaultProps","UncontrolledCollapse","_Component","props","_this","call","togglers","removeEventListeners","toggle","bind","state","isOpen","_proto","prototype","componentDidMount","length","componentWillUnmount","e","setState","_ref","preventDefault","render","createElement"],"mappings":"AAAA,OAAOA,QAAP,MAAqB,oCAArB;AACA,OAAOC,sBAAP,MAAmC,kDAAnC;AACA,OAAOC,cAAP,MAA2B,0CAA3B;AACA,OAAOC,KAAP,IAAgBC,SAAhB,QAAiC,OAAjC;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,QAAP,MAAqB,YAArB;AACA,SAASC,IAAT,EAAeC,eAAf,EAAgCC,mBAAhC,EAAqDC,yBAArD,QAAsF,SAAtF;AACA,IAAIC,QAAQ,GAAG,CAAC,cAAD,EAAiB,aAAjB,CAAf;AACA,IAAIC,SAAS,GAAG;AACdC,EAAAA,WAAW,EAAER,SAAS,CAACS,IADT;AAEdC,EAAAA,OAAO,EAAEV,SAAS,CAACW,MAAV,CAAiBC,UAFZ;AAGdC,EAAAA,YAAY,EAAEb,SAAS,CAACc,OAAV,CAAkBd,SAAS,CAACW,MAA5B;AAHA,CAAhB;AAKA,IAAII,YAAY,GAAG;AACjBF,EAAAA,YAAY,EAAET;AADG,CAAnB;;AAIA,IAAIY,oBAAoB,GAAG,aAAa,UAAUC,UAAV,EAAsB;AAC5DpB,EAAAA,cAAc,CAACmB,oBAAD,EAAuBC,UAAvB,CAAd;;AAEA,WAASD,oBAAT,CAA8BE,KAA9B,EAAqC;AACnC,QAAIC,KAAJ;;AAEAA,IAAAA,KAAK,GAAGF,UA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AACS,MAAP,GAAgB,SAASA,MAAT,GAAkB;AAChC,WAAO,aAAatC,KAAK,CAACuC,aAAN,CAAoBpC,QAApB,EAA8BN,QAAQ,CAAC;AACzD+B,MAAAA,MAAM,EAAE,KAAKD,KAAL,CAAWC;AADsC,KAAD,EAEvDxB,IAAI,CAAC,KAAKgB,KAAN,EAAaZ,QAAb,CAFmD,CAAtC,CAApB;AAGD,GAJD;;AAMA,SAAOU,oBAAP;AACD,CAjDuC,CAiDtCjB,SAjDsC,CAAxC;;AAmDAiB,oBAAoB,CAACT,SAArB,GAAiCA,SAAjC;AACAS,oBAAoB,CAACD,YAArB,GAAoCA,YAApC;AACA,eAAeC,oBAAf","sourcesContent":["import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _assertThisInitialized from \"@babel/runtime/helpers/esm/assertThisInitialized\";\nimport _inheritsLoose from \"@babel/runtime/helpers/esm/inheritsLoose\";\nimport React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport Collapse from './Collapse';\nimport { omit, findDOMElements, defaultToggleEvents, addMultipleEventListeners } from './utils';\nvar omitKeys = ['toggleEvents', 'defaultOpen'];\nvar propTypes = {\n defaultOpen: PropTypes.bool,\n toggler: PropTypes.string.isRequired,\n toggleEvents: PropTypes.arrayOf(PropTypes.string)\n};\nvar defaultProps = {\n toggleEvents: defaultToggleEvents\n};\n\nvar UncontrolledCollapse = /*#__PURE__*/function (_Component) {\n _inheritsLoose(UncontrolledCollapse, _Component);\n\n function UncontrolledCollapse(props) {\n var _this;\n\n _this = _Component.call(this, props) || this;\n _this.togglers = null;\n _this.removeEventListeners = null;\n _this.toggle = _this.toggle.bind(_assertThisInitialized(_this));\n _this.state = {\n isOpen: props.defaultOpen || false\n };\n return _this;\n }\n\n var _proto = UncontrolledCollapse.prototype;\n\n _proto.componentDidMount = function componentDidMount() {\n this.togglers = findDOMElements(this.props.toggler);\n\n if (this.togglers.length) {\n this.removeEventListeners = addMultipleEventListeners(this.togglers, this.toggle, this.props.toggleEvents);\n }\n };\n\n _proto.componentWillUnmount = function componentWillUnmount() {\n if (this.togglers.length && this.removeEventListeners) {\n this.removeEventListeners();\n }\n };\n\n _proto.toggle = function toggle(e) {\n this.setState(function (_ref) {\n var isOpen = _ref.isOpen;\n return {\n isOpen: !isOpen\n };\n });\n e.preventDefault();\n };\n\n _proto.render = function render() {\n return /*#__PURE__*/React.createElement(Collapse, _extends({\n isOpen: this.state.isOpen\n }, omit(this.props, omitKeys)));\n };\n\n return UncontrolledCollapse;\n}(Component);\n\nUncontrolledCollapse.propTypes = propTypes;\nUncontrolledCollapse.defaultProps = defaultProps;\nexport default UncontrolledCollapse;"]},"metadata":{},"sourceType":"module"} |