mirror of
https://github.com/idanoo/GoScrobble.git
synced 2024-11-24 09:25:15 +00:00
1 line
11 KiB
JSON
1 line
11 KiB
JSON
|
{"ast":null,"code":"import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport { mapToCssModules } from './utils';\nimport CustomFileInput from './CustomFileInput';\nvar propTypes = {\n className: PropTypes.string,\n id: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,\n type: PropTypes.string.isRequired,\n label: PropTypes.node,\n inline: PropTypes.bool,\n valid: PropTypes.bool,\n invalid: PropTypes.bool,\n bsSize: PropTypes.string,\n htmlFor: PropTypes.string,\n cssModule: PropTypes.object,\n children: PropTypes.oneOfType([PropTypes.node, PropTypes.array, PropTypes.func]),\n innerRef: PropTypes.oneOfType([PropTypes.object, PropTypes.string, PropTypes.func])\n};\n\nfunction CustomInput(props) {\n var className = props.className,\n label = props.label,\n inline = props.inline,\n valid = props.valid,\n invalid = props.invalid,\n cssModule = props.cssModule,\n children = props.children,\n bsSize = props.bsSize,\n innerRef = props.innerRef,\n htmlFor = props.htmlFor,\n attributes = _objectWithoutPropertiesLoose(props, [\"className\", \"label\", \"inline\", \"valid\", \"invalid\", \"cssModule\", \"children\", \"bsSize\", \"innerRef\", \"htmlFor\"]);\n\n var type = attributes.type;\n var customClass = mapToCssModules(classNames(className, \"custom-\" + type, bsSize ? \"custom-\" + type + \"-\" + bsSize : false), cssModule);\n var validationClassNames = mapToCssModules(classNames(invalid && \"is-invalid\", valid && \"is-valid\"), cssModule);\n var labelHtmlFor = htmlFor || attributes.id;\n\n if (type === \"select\") {\n var _type = attributes.type,\n _rest = _objectWithoutPropertiesLoose(attributes, [\"type\"]);\n\n return /*#__PURE__*/React.createElement(\"select\", _extends({}, _rest, {\n ref: innerRef,\n className: classNames(validationClassNames, customClass),\n \"aria-invalid\": invalid\n }), children);\n }\n\n if (type === \"file\") {\n return /*#__PURE__*/React.createElement(CustomFileInput, props);\n }\n\n if (type !== \"checkbox\" && type !== \"radio\" && type !== \"switch\") {\n return /*#__PURE__*/React.createElement(\"input\", _extends({}, attributes, {\n ref: innerRef,\n \"aria-invalid\": invalid,\n className: classNames(validationClassNames, customClass)\n }));\n }\n\n var wrapperClasses = classNames(customClass, mapToCssModules(classNames(\"custom-control\", {\n \"custom-control-inline\": inline\n }), cssModule));\n\n var hidden = attributes.hidden,\n rest = _objectWithoutPropertiesLoose(attributes, [\"hidden\"]);\n\n return /*#__PURE__*/React.createElement(\"div\", {\n className: wrapperClasses,\n hidden: hidden || false\n }, /*#__PURE__*/React.createElement(\"input\", _extends({}, rest, {\n type: type === \"switch\" ? \"checkbox\" : type,\n ref: innerRef,\n \"aria-invalid\": invalid,\n className: classNames(validationClassNames, mapToCssModules(\"custom-control-input\", cssModule))\n })), /*#__PURE__*/React.createElement(\"label\", {\n className: mapToCssModules(\"custom-control-label\", cssModule),\n htmlFor: labelHtmlFor\n }, label), children);\n}\n\nCustomInput.propTypes = propTypes;\nexport default CustomInput;","map":{"version":3,"sources":["/app/node_modules/reactstrap/es/CustomInput.js"],"names":["_extends","_objectWithoutPropertiesLoose","React","PropTypes","classNames","mapToCssModules","CustomFileInput","propTypes","className","string","id","oneOfType","number","isRequired","type","label","node","inline","bool","valid","invalid","bsSize","htmlFor","cssModule","object","children","array","func","innerRef","CustomInput","props","attributes","customClass","validationClassNames","labelHtmlFor","_type","_rest","createElement","ref","wrapperClasses","hidden","rest"],"mappings":"AAAA,OAAOA,QAAP,MAAqB,oCAArB;A
|