mirror of
https://github.com/idanoo/GoScrobble.git
synced 2024-11-25 09:55:15 +00:00
1 line
13 KiB
JSON
1 line
13 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 classNames from 'classnames';\nimport { mapToCssModules } from './utils';\nvar propTypes = {\n className: PropTypes.string,\n id: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,\n label: PropTypes.node,\n valid: PropTypes.bool,\n invalid: PropTypes.bool,\n bsSize: PropTypes.string,\n htmlFor: PropTypes.string,\n cssModule: PropTypes.object,\n onChange: PropTypes.func,\n children: PropTypes.oneOfType([PropTypes.node, PropTypes.array, PropTypes.func]),\n innerRef: PropTypes.oneOfType([PropTypes.object, PropTypes.string, PropTypes.func])\n};\n\nvar CustomFileInput = /*#__PURE__*/function (_React$Component) {\n _inheritsLoose(CustomFileInput, _React$Component);\n\n function CustomFileInput(props) {\n var _this;\n\n _this = _React$Component.call(this, props) || this;\n _this.state = {\n files: null\n };\n _this.onChange = _this.onChange.bind(_assertThisInitialized(_this));\n return _this;\n }\n\n var _proto = CustomFileInput.prototype;\n\n _proto.onChange = function onChange(e) {\n var input = e.target;\n var onChange = this.props.onChange;\n var files = this.getSelectedFiles(input);\n\n if (typeof onChange === \"function\") {\n onChange.apply(void 0, arguments);\n }\n\n this.setState({\n files: files\n });\n };\n\n _proto.getSelectedFiles = function getSelectedFiles(input) {\n var multiple = this.props.multiple;\n\n if (multiple && input.files) {\n var files = [].slice.call(input.files);\n return files.map(function (file) {\n return file.name;\n }).join(\", \");\n }\n\n if (input.value.indexOf(\"fakepath\") !== -1) {\n var parts = input.value.split(\"\\\\\");\n return parts[parts.length - 1];\n }\n\n return input.value;\n };\n\n _proto.render = function render() {\n var _this$props = this.props,\n className = _this$props.className,\n label = _this$props.label,\n valid = _this$props.valid,\n invalid = _this$props.invalid,\n cssModule = _this$props.cssModule,\n children = _this$props.children,\n bsSize = _this$props.bsSize,\n innerRef = _this$props.innerRef,\n htmlFor = _this$props.htmlFor,\n type = _this$props.type,\n onChange = _this$props.onChange,\n dataBrowse = _this$props.dataBrowse,\n hidden = _this$props.hidden,\n attributes = _objectWithoutPropertiesLoose(_this$props, [\"className\", \"label\", \"valid\", \"invalid\", \"cssModule\", \"children\", \"bsSize\", \"innerRef\", \"htmlFor\", \"type\", \"onChange\", \"dataBrowse\", \"hidden\"]);\n\n var customClass = mapToCssModules(classNames(className, \"custom-file\"), cssModule);\n var validationClassNames = mapToCssModules(classNames(invalid && \"is-invalid\", valid && \"is-valid\"), cssModule);\n var labelHtmlFor = htmlFor || attributes.id;\n var files = this.state.files;\n return /*#__PURE__*/React.createElement(\"div\", {\n className: customClass,\n hidden: hidden || false\n }, /*#__PURE__*/React.createElement(\"input\", _extends({\n type: \"file\"\n }, attributes, {\n ref: innerRef,\n \"aria-invalid\": invalid,\n className: classNames(validationClassNames, mapToCssModules(\"custom-file-input\", cssModule)),\n onChange: this.onChange\n })), /*#__PURE__*/React.createElement(\"label\", {\n className: mapToCssModules(\"custom-file-label\", cssModule),\n htmlFor: labelHtmlFor,\n \"data-browse\": dataBrowse\n }, files || label || \"Choose file\"), children);\n };\n\n return CustomFileInput;\n}(React.Component);\n\nCustomFileInput.propTypes = propTypes;\nexport default CustomFileInput;","map":{"version":3,"sources":["/app/node_modules/reactstrap/es/CustomFileInput.js"],"names":["_extends","_objectWithoutPropertiesLoose","_assertThisInitialized","_inheritsLoose","React","PropTypes","classNames","mapToCssModules","propTypes","className","string","id","oneOfType","number","isRequired","label","node","valid","bool","invalid","bsSize","htmlFor","cssModule","object","onChange","func","children","array","innerRef","CustomFileInput","_React$Component","props","_this","call","state","files","bind","_proto","prototype","e","input","target","getSelectedFiles","apply","arguments","setState","multiple","slice","map","file","name","join","value","indexOf","parts","split","length","render","_this$props","type","dataBrowse","hidden","attributes","customClass","validationClassNames","labelHtmlFor","createElement","ref","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,UAAP,MAAuB,YAAvB;AACA,SAASC,eAAT,QAAgC,SAAhC;AACA,IAAIC,SAAS,GAAG;AACdC,EAAAA,SAAS,EAAEJ,SAAS,CAACK,MADP;AAEdC,EAAAA,EAAE,EAAEN,SAAS,CAACO,SAAV,CAAoB,CAACP,SAAS,CAACK,MAAX,EAAmBL,SAAS,CAACQ,MAA7B,CAApB,EAA0DC,UAFhD;AAGdC,EAAAA,KAAK,EAAEV,SAAS,CAACW,IAHH;AAIdC,EAAAA,KAAK,EAAEZ,SAAS,CAACa,IAJH;AAKdC,EAAAA,OAAO,EAAEd,SAAS,CAACa,IALL;AAMdE,EAAAA,MAAM,EAAEf,SAAS,CAACK,MANJ;AAOdW,EAAAA,OAAO,EAAEhB,SAAS,CAACK,MAPL;AAQdY,EAAAA,SAAS,EAAEjB,SAAS,CAACkB,MARP;AASdC,EAAAA,QAAQ,EAAEnB,SAAS,CAACoB,IATN;AAUdC,EAAAA,QAAQ,EAAErB,SAAS,CAACO,SAAV,CAAoB,CAACP,SAAS,CAACW,IAAX,EAAiBX,SAAS,CAACsB,KAA3B,EAAkCtB,SAAS,CAACoB,IAA5C,CAApB,CAVI;AAWdG,EAAAA,QAAQ,EAAEvB,SAAS,CAACO,SAAV,CAAoB,CAACP,SAAS,CAACkB,MAAX,EAAmBlB,SAAS,CAACK,MAA7B,EAAqCL,SAAS,CAACoB,IAA/C,CAApB;AAXI,CAAhB;;AAcA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AAIpB,KAAT,IAAkB,aAJH,CAVE,EAciBW,QAdjB,CAApB;AAeD,GApCD;;AAsCA,SAAOG,eAAP;AACD,CAvFkC,CAuFjCzB,KAAK,CAACgE,SAvF2B,CAAnC;;AAyFAvC,eAAe,CAACrB,SAAhB,GAA4BA,SAA5B;AACA,eAAeqB,eAAf","sourcesContent":["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 classNames from 'classnames';\nimport { mapToCssModules } from './utils';\nvar propTypes = {\n className: PropTypes.string,\n id: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,\n label: PropTypes.node,\n valid: PropTypes.bool,\n invalid: PropTypes.bool,\n bsSize: PropTypes.string,\n htmlFor: PropTypes.string,\n cssModule: PropTypes.object,\n onChange: PropTypes.func,\n children: PropTypes.oneOfType([PropTypes.node, PropTypes.array, PropTypes.func]),\n innerRef: PropTypes.oneOfType([PropTypes.object, PropTypes.string, PropTypes.func])\n};\n\nvar CustomFileInput = /*#__PURE__*/function (_React$Component) {\n _inheritsLoose(CustomFileInput, _React$Component);\n\n function CustomFileInput(props) {\n var _this;\n\n _this = _React$Component.call(this, props) || this;\n _this.state = {\n files: null\n };\n _this.onChange = _this.onChange.bind(_assertThisInitialized(_this));\n return _this;\n }\n\n var _proto = CustomFileInput.prototype;\n\n _proto.onChange = function onChange(e) {\n var input = e.target;\n var onChange = this.props.onChange;\n var files = this.getSelectedFiles(input);\n\n if (typeof onChange === \"function\") {\n onChange.apply(void 0, arguments);\n }\n\n this.setState({\n files: files\n });\n };\n\n _proto.getSelectedFiles = function getSelectedFiles(input) {\n var multiple = this.props.multiple;\n\n if (multiple && input.files) {\n var files = [].slice.call(input.files);\n return files.map(function (file) {\n return file.name;\n }).join(\", \");\n }\n\n if (input.value.indexOf(\"fakepath\") !== -1) {\n var parts = input.value.split(\"\\\\\");\n return parts[parts.length - 1];\n }\n\n return input.value;\n };\n\n _proto.render = function render() {\n var _this$props = this.props,\n className = _this$props.className,\n label = _this$props.label,\n valid = _this$props.valid,\n invalid = _this$props.invalid,\n cssModule = _this$props.cssModule,\n children = _this$props.children,\n bsSize = _this$props.bsSize,\n innerRef = _this$props.innerRef,\n htmlFor = _this$props.htmlFor,\n type = _this$props.type,\n onChange = _this$props.onChange,\n dataBrowse = _this$props.dataBrowse,\n hidden = _this$props.hidden,\n attributes = _objectWithoutPropertiesLoose(_this$props, [\"className\", \"label\", \"valid\", \"invalid\", \"cssModule\", \"children\", \"bsSize\", \"innerRef\", \"htmlFor\", \"type\", \"onChange\", \"dataBrowse\", \"hidden\"]);\n\n var customClass = mapToCssModules(classNames(className, \"custom-file\"), cssModule);\n var validationClassNames = mapToCssModules(classNames(invalid && \"is-invalid\", valid && \"is-valid\"), cssModule);\n var labelHtmlFor = htmlFor || attributes.id;\n var files = this.state.files;\n return /*#__PURE__*/React.createElement(\"div\", {\n className: customClass,\n hidden: hidden || false\n }, /*#__PURE__*/React.createElement(\"input\", _extends({\n type: \"file\"\n }, attributes, {\n ref: innerRef,\n \"aria-invalid\": invalid,\n className: classNames(validationClassNames, mapToCssModules(\"custom-file-input\", cssModule)),\n onChange: this.onChange\n })), /*#__PURE__*/React.createElement(\"label\", {\n className: mapToCssModules(\"custom-file-label\", cssModule),\n htmlFor: labelHtmlFor,\n \"data-browse\": dataBrowse\n }, files || label || \"Choose file\"), children);\n };\n\n return CustomFileInput;\n}(React.Component);\n\nCustomFileInput.propTypes = propTypes;\nexport default CustomFileInput;"]},"metadata":{},"sourceType":"module"} |