react-forms/dist/index.js.map

1 line
459 KiB
Plaintext
Raw Normal View History

2019-03-04 18:49:46 +01:00
{"version":3,"file":"index.js","sources":["../src/FormContext.js","../src/FormTranslationContext.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","../node_modules/moment/moment.js","../src/DatePicker.js","../src/FilePicker.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\nconst FormTranslationContext = React.createContext({\n\trenderText: (text) => (text)\n});\n\nexport default FormTranslationContext\n\nexport class FormTranslationConsumer extends Component\n{\n render()\n {\n return (\n <FormTranslationContext.Consumer>\n {(props) => this.props.children(props)}\n </FormTranslationContext.Consumer>\n )\n }\n}","import React, {Component} from 'react';\nimport {FormTranslationConsumer} from './FormTranslationContext'\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.renderText(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\nChe