react-forms/dist/index.js.map

1 line
166 KiB
Plaintext
Raw Normal View History

2019-03-01 14:43:37 +01:00
{"version":3,"file":"index.js","sources":["../src/FormContext.js","../src/FormItemError.js","../src/CheckBox.js","../node_modules/classnames/index.js","../node_modules/react-lifecycles-compat/react-lifecycles-compat.es.js","../node_modules/react-transition-group/utils/ChildMapping.js","../node_modules/react-transition-group/TransitionGroup.js","../node_modules/react-toastify/lib/utils/constant.js","../node_modules/react-toastify/lib/utils/propValidator.js","../node_modules/react-toastify/lib/components/ProgressBar.js","../node_modules/react-toastify/lib/components/Toast.js","../node_modules/react-toastify/lib/components/CloseButton.js","../node_modules/react-transition-group/utils/PropTypes.js","../node_modules/react-transition-group/Transition.js","../node_modules/react-toastify/lib/utils/cssTransition.js","../node_modules/react-toastify/lib/components/Transitions.js","../node_modules/react-toastify/lib/utils/eventManager.js","../node_modules/react-toastify/lib/components/ToastContainer.js","../node_modules/react-toastify/lib/toast.js","../node_modules/react-toastify/lib/index.js","../src/Form.js","../src/Input.js","../src/OptionGroup.js","../src/Option.js","../src/RadioGroup.js","../src/Radio.js","../src/Submit.js","../src/TextArea.js","../src/FormTranslationContext.js"],"sourcesContent":["import React, { Component } from 'react'\n\nconst FormContext = React.createContext({ data: null });\n\nexport default FormContext\n\nexport class FormConsumer extends Component\n{\n render()\n {\n return (\n <FormContext.Consumer>\n {(props) => this.props.children(props)}\n </FormContext.Consumer>\n )\n }\n}","import React, {Component} from 'react';\n\nexport default class FormItemError extends Component\n{\n render() {\n const data = this.props.data\n\n if (!data || !data.errors || !data.errors[this.props.name]) return null\n\n return (\n \t<FormTranslationConsumer>\n \t{(translator) => this.renderError(data, translator)}\n </FormTranslationConsumer>\n )\n }\n\n renderError(data, translator)\n {\n \treturn <p className=\"text-danger\">{translator.handleText(data.errors[this.props.name].error)}</p>\n }\n}","import React, {Component} from 'react';\nimport {FormConsumer} from \"./FormContext\";\nimport FormItemError from \"./FormItemError\";\n\nexport default class CheckBox extends Component\n{\n render()\n {\n return (\n <FormConsumer>\n {(data) => this.renderCheckBox(data)}\n </FormConsumer>\n )\n }\n\n renderCheckBox(data)\n {\n let props = {...this.props}\n if (props.children) delete props.children\n if (props.onChangeValue) delete props.onChangeValue\n return (\n <div className=\"form-check\">\n <input\n type=\"checkbox\"\n checked={this.props.value}\n onChange={(e) => this.props.onChangeValue(e.target.checked)}\n {...props} />\n {this.renderLabel(data)}\n <FormItemError name={this.props.name} data={data} />\n </div>\n )\n }\n\n renderLabel(data)\n {\n if (this.props.children.length) {\n return (\n <label className=\"form-check-label\" htmlFor={this.props.id}>{this.props.children}</label>\n )\n }\n }\n}\n\nCheckBox.defaultProps = {\n name: 'checkbox',\n id: 'checkbox',\n className: 'form-check-input',\n onChangeValue: (checked) => {}\n}","/*!\n Copyright (c) 2017 Jed Watson.\n Licensed under the MIT License (MIT), see\n http://jedwatson.github.io/classnames\n*/\n/* global define */\n\n(function () {\n\t'use strict';\n\n\tvar hasOwn = {}.hasOwnProperty;\n\n\tfunction classNames () {\n\t\tvar classes = [];\n\n\t\tfor (var i = 0; i < arguments.length; i++) {\n\t\t\tvar arg = arguments[i];\n\t\t\tif (!arg) continue;\n\n\t\t\tvar argType = typeof arg;\n\n\t\t\tif (argType === 'string'