mirror of
https://github.com/idanoo/GoScrobble.git
synced 2024-11-24 09:25:15 +00:00
1 line
8.4 KiB
JSON
1 line
8.4 KiB
JSON
{"ast":null,"code":"import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _assertThisInitialized from \"@babel/runtime/helpers/esm/assertThisInitialized\";\nimport _inheritsLoose from \"@babel/runtime/helpers/esm/inheritsLoose\";\nimport React from \"react\";\nimport PropTypes from 'prop-types';\nimport Button from \"./Button\";\nimport classNames from 'classnames';\nimport { mapToCssModules } from './utils';\nvar propTypes = {\n onClick: PropTypes.func,\n onBlur: PropTypes.func,\n onFocus: PropTypes.func,\n defaultValue: PropTypes.bool\n};\nvar defaultProps = {\n defaultValue: false\n};\n\nvar ButtonToggle = /*#__PURE__*/function (_React$Component) {\n _inheritsLoose(ButtonToggle, _React$Component);\n\n function ButtonToggle(props) {\n var _this;\n\n _this = _React$Component.call(this, props) || this;\n _this.state = {\n toggled: props.defaultValue,\n focus: false\n };\n _this.onBlur = _this.onBlur.bind(_assertThisInitialized(_this));\n _this.onFocus = _this.onFocus.bind(_assertThisInitialized(_this));\n _this.onClick = _this.onClick.bind(_assertThisInitialized(_this));\n return _this;\n }\n\n var _proto = ButtonToggle.prototype;\n\n _proto.onBlur = function onBlur(e) {\n if (this.props.onBlur) {\n this.props.onBlur(e);\n }\n\n this.setState({\n focus: false\n });\n };\n\n _proto.onFocus = function onFocus(e) {\n if (this.props.onFocus) {\n this.props.onFocus(e);\n }\n\n this.setState({\n focus: true\n });\n };\n\n _proto.onClick = function onClick(e) {\n if (this.props.onClick) {\n this.props.onClick(e);\n }\n\n this.setState(function (_ref) {\n var toggled = _ref.toggled;\n return {\n toggled: !toggled\n };\n });\n };\n\n _proto.render = function render() {\n var _this$props = this.props,\n className = _this$props.className,\n attributes = _objectWithoutPropertiesLoose(_this$props, [\"className\"]);\n\n var classes = mapToCssModules(classNames(className, {\n focus: this.state.focus\n }), this.props.cssModule);\n return /*#__PURE__*/React.createElement(Button, _extends({\n active: this.state.toggled,\n onBlur: this.onBlur,\n onFocus: this.onFocus,\n onClick: this.onClick,\n className: classes\n }, attributes));\n };\n\n return ButtonToggle;\n}(React.Component);\n\nButtonToggle.propTypes = propTypes;\nButtonToggle.defaultProps = defaultProps;\nexport default ButtonToggle;","map":{"version":3,"sources":["/app/node_modules/reactstrap/es/ButtonToggle.js"],"names":["_extends","_objectWithoutPropertiesLoose","_assertThisInitialized","_inheritsLoose","React","PropTypes","Button","classNames","mapToCssModules","propTypes","onClick","func","onBlur","onFocus","defaultValue","bool","defaultProps","ButtonToggle","_React$Component","props","_this","call","state","toggled","focus","bind","_proto","prototype","e","setState","_ref","render","_this$props","className","attributes","classes","cssModule","createElement","active","Component"],"mappings":"AAAA,OAAOA,QAAP,MAAqB,oCAArB;AACA,OAAOC,6BAAP,MAA0C,yDAA1C;AACA,OAAOC,sBAAP,MAAmC,kDAAnC;AACA,OAAOC,cAAP,MAA2B,0CAA3B;AACA,OAAOC,KAAP,MAAkB,OAAlB;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,MAAP,MAAmB,UAAnB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AACA,SAASC,eAAT,QAAgC,SAAhC;AACA,IAAIC,SAAS,GAAG;AACdC,EAAAA,OAAO,EAAEL,SAAS,CAACM,IADL;AAEdC,EAAAA,MAAM,EAAEP,SAAS,CAACM,IAFJ;AAGdE,EAAAA,OAAO,EAAER,SAAS,CAACM,IAHL;AAIdG,EAAAA,YAAY,EAAET,SAAS,CAACU;AAJV,CAAhB;AAMA,IAAIC,YAAY,GAAG;AACjBF,EAAAA,YAAY,EAAE;AADG,CAAnB;;AAIA,IAAIG,YAAY,GAAG,aAAa,UAAUC,gBAAV,EAA4B;AAC1Df,EAAAA,cAAc,CAACc,YAAD,EAAeC,gBAAf,CAAd;;AAEA,WAASD,YAAT,CAAsBE,KAAtB,EAA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nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _assertThisInitialized from \"@babel/runtime/helpers/esm/assertThisInitialized\";\nimport _inheritsLoose from \"@babel/runtime/helpers/esm/inheritsLoose\";\nimport React from \"react\";\nimport PropTypes from 'prop-types';\nimport Button from \"./Button\";\nimport classNames from 'classnames';\nimport { mapToCssModules } from './utils';\nvar propTypes = {\n onClick: PropTypes.func,\n onBlur: PropTypes.func,\n onFocus: PropTypes.func,\n defaultValue: PropTypes.bool\n};\nvar defaultProps = {\n defaultValue: false\n};\n\nvar ButtonToggle = /*#__PURE__*/function (_React$Component) {\n _inheritsLoose(ButtonToggle, _React$Component);\n\n function ButtonToggle(props) {\n var _this;\n\n _this = _React$Component.call(this, props) || this;\n _this.state = {\n toggled: props.defaultValue,\n focus: false\n };\n _this.onBlur = _this.onBlur.bind(_assertThisInitialized(_this));\n _this.onFocus = _this.onFocus.bind(_assertThisInitialized(_this));\n _this.onClick = _this.onClick.bind(_assertThisInitialized(_this));\n return _this;\n }\n\n var _proto = ButtonToggle.prototype;\n\n _proto.onBlur = function onBlur(e) {\n if (this.props.onBlur) {\n this.props.onBlur(e);\n }\n\n this.setState({\n focus: false\n });\n };\n\n _proto.onFocus = function onFocus(e) {\n if (this.props.onFocus) {\n this.props.onFocus(e);\n }\n\n this.setState({\n focus: true\n });\n };\n\n _proto.onClick = function onClick(e) {\n if (this.props.onClick) {\n this.props.onClick(e);\n }\n\n this.setState(function (_ref) {\n var toggled = _ref.toggled;\n return {\n toggled: !toggled\n };\n });\n };\n\n _proto.render = function render() {\n var _this$props = this.props,\n className = _this$props.className,\n attributes = _objectWithoutPropertiesLoose(_this$props, [\"className\"]);\n\n var classes = mapToCssModules(classNames(className, {\n focus: this.state.focus\n }), this.props.cssModule);\n return /*#__PURE__*/React.createElement(Button, _extends({\n active: this.state.toggled,\n onBlur: this.onBlur,\n onFocus: this.onFocus,\n onClick: this.onClick,\n className: classes\n }, attributes));\n };\n\n return ButtonToggle;\n}(React.Component);\n\nButtonToggle.propTypes = propTypes;\nButtonToggle.defaultProps = defaultProps;\nexport default ButtonToggle;"]},"metadata":{},"sourceType":"module"} |