mirror of
https://github.com/idanoo/GoScrobble.git
synced 2024-11-23 00:45:16 +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,EAA6B;AAC3B,QAAIC,KAAJ;;AAEAA,IAAAA,KAAK,GAAGF,gBAAgB,CAACG,IAAjB,CAAsB,IAAtB,EAA4BF,KAA5B,KAAsC,IAA9C;AACAC,IAAAA,KAAK,CAACE,KAAN,GAAc;AACZC,MAAAA,OAAO,EAAEJ,KAAK,CAACL,YADH;AAEZU,MAAAA,KAAK,EAAE;AAFK,KAAd;AAIAJ,IAAAA,KAAK,CAACR,MAAN,GAAeQ,KAAK,CAACR,MAAN,CAAaa,IAAb,CAAkBvB,s
|