{"_id":"@a2software/formsy-react","_rev":"2-28019e63b931446fb62556ddc78f2888","name":"@a2software/formsy-react","dist-tags":{"latest":"1.1.5"},"versions":{"1.0.0":{"name":"@a2software/formsy-react","version":"1.0.0","description":"A form input builder and validator for React","keywords":["form","forms","formsy","react","react-component","validation"],"standard-version":{"skip":{"tag":true}},"license":"MIT","homepage":"https://github.com/amr/formsy-react","bugs":{"url":"https://github.com/amr/formsy-react/issues"},"repository":{"type":"git","url":"https://github.com/amr/formsy-react.git"},"author":{"name":"Christian Alfoni"},"main":"lib/index.js","scripts":{"build":"NODE_ENV=production webpack -p --config webpack.config.js && yarn run prepublish","examples":"webpack-dev-server --config examples/webpack.config.js --content-base examples","lint":"eslint src/**/*.js","prepublish":"rm -Rf ./lib && babel ./src/ -d ./lib/","changelog":"standard-changelog","test":"babel-node testrunner"},"dependencies":{"form-data-to-object":"^0.2.0","prop-types":"^15.5.10"},"devDependencies":{"babel-cli":"^6.24.1","babel-eslint":"^8.1.2","babel-loader":"^7.1.1","babel-preset-es2015":"^6.24.1","babel-preset-react":"^6.24.1","babel-preset-stage-2":"^6.24.1","eslint":"^4.14.0","eslint-config-airbnb":"^16.1.0","eslint-plugin-import":"^2.7.0","eslint-plugin-jsx-a11y":"^6.0.3","eslint-plugin-react":"^7.5.1","jsdom":"^11.5.1","nodeunit":"^0.11.1","react":"^16.2.0 || ^16.0.0","react-addons-pure-render-mixin":"^15.6.0","react-addons-test-utils":"^15.6.0","react-dom":"^16.2.0 || ^16.0.0","sinon":"^4.1.3","standard-changelog":"^1.0.7","standard-version":"^4.2.0","webpack":"^3.10.0","webpack-dev-server":"^2.9.7"},"peerDependencies":{"react":"^15.6.1 || ^16.0.0","react-dom":"^15.6.1 || ^16.0.0"},"licenseText":"The MIT License (MIT)\n\nCopyright (c) 2014-2016 PatientSky A/S\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n","_id":"@a2software/formsy-react@1.0.0","dist":{"shasum":"8e4eceaf1e2d8f25a61ba04f7df2bac36a61db1f","integrity":"sha512-j0wkNiSUm5yn9EgQID1XXUOsNc7ynK0LUbdYFG+7wkA8vLFUr1tXCJ+FwmrHMhhI2+tup1Sue9B5hsnTyF5cpg==","tarball":"https://registry.npmjs.org/@a2software/formsy-react/-/formsy-react-1.0.0.tgz","fileCount":10,"unpackedSize":47506,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcvF9/CRA9TVsSAnZWagAAdb8P/A5mtTmYA4OfMKcV2U8n\n4pkZVO4qeEf1llJC41wV+tJ9EPhuyfeHSuqjVvgcjf8LQtCIS5Vw32Na5NKw\nptL7QSdOW8H58ufwmIMwy0v1ubt4pdlQrpzRR9KPDoh5M+h3ZrAvq0MCeTGF\n/Gkdy1IBHmI8wNbWnVnZSyKO6avU4hQLdxaPfx0mng5XANIpFfoAsLOYIpbU\noz6NPmJvJUfuu8goTebR0Ixd95xjc7PlOGFNB7oVULEtN7JDGog0z73gd79d\n5IloAYtT3oMghXkLjntNQfOSeEhg5+qj8GOCBfnqr2yr0WPuGCQgr3Q1CMd+\nxNXGSlTEslLp5i1FOeVbjkvQH06W+Z/oxT7SpZB9FVYYKjWi7JnTh9UN0x/3\nqO+rrE3fqc7kUqeYrkM1IDHfzut/OwBxxF5VivRxQmFUVjr8ZvNjctPRCFh8\nyCdqHMAEc6xMEJfUFEa79Sr4jDBjr38f1Go0tof833moLZO1+02qkdDRqGwS\nkJEoe9/7WIsYKRCvYBv6xWgYYMRrZ4He1jEHItmAxg6+Z8kSycuL//PnFkZ2\no0BQ6zs8067Q+falcm7o0PRDgzqcaYt540HHbfhtH41ou+cmjK4Co80XHMkd\nk/SBL+np1X58pi2LYudRv1bkH5XlbzVf4ZbsgjXcS5Azk0RJbpafNAns/rBK\n/nB3\r\n=BUS0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBSosNwZLGQotYd0y0Y0Apzbec5eeY+vwk3DlKrxhbwqAiBLO83XCAZzJqSjpa3QR3doFJwPHBTb3jIx9MwyEkIDnw=="}]},"maintainers":[{"name":"amrmostafa","email":"amr.mostafa@gmail.com"}],"_npmUser":{"name":"amrmostafa","email":"amr.mostafa@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/formsy-react_1.0.0_1555849086875_0.4290388046998692"},"_hasShrinkwrap":false},"1.1.5":{"name":"@a2software/formsy-react","version":"1.1.5","description":"A form input builder and validator for React","keywords":["form","forms","formsy","react","react-component","validation"],"standard-version":{"skip":{"tag":true}},"license":"MIT","homepage":"https://github.com/amr/formsy-react","bugs":{"url":"https://github.com/amr/formsy-react/issues"},"repository":{"type":"git","url":"https://github.com/amr/formsy-react.git"},"author":{"name":"Christian Alfoni"},"main":"lib/index.js","scripts":{"build":"NODE_ENV=production webpack -p --config webpack.config.js && yarn run prepublish","examples":"webpack-dev-server --config examples/webpack.config.js --content-base examples","lint":"eslint src/**/*.js","prepublish":"rm -Rf ./lib && babel ./src/ -d ./lib/","changelog":"standard-changelog","test":"babel-node testrunner"},"dependencies":{"form-data-to-object":"^0.2.0","prop-types":"^15.5.10"},"devDependencies":{"babel-cli":"^6.24.1","babel-eslint":"^8.1.2","babel-loader":"^7.1.1","babel-preset-es2015":"^6.24.1","babel-preset-react":"^6.24.1","babel-preset-stage-2":"^6.24.1","eslint":"^4.14.0","eslint-config-airbnb":"^16.1.0","eslint-plugin-import":"^2.7.0","eslint-plugin-jsx-a11y":"^6.0.3","eslint-plugin-react":"^7.5.1","jsdom":"^11.5.1","nodeunit":"^0.11.1","react":"^16.2.0 || ^16.0.0","react-addons-pure-render-mixin":"^15.6.0","react-addons-test-utils":"^15.6.0","react-dom":"^16.2.0 || ^16.0.0","sinon":"^4.1.3","standard-changelog":"^1.0.7","standard-version":"^4.2.0","webpack":"^3.10.0","webpack-dev-server":"^2.9.7"},"peerDependencies":{"react":"^15.6.1 || ^16.0.0","react-dom":"^15.6.1 || ^16.0.0"},"licenseText":"The MIT License (MIT)\n\nCopyright (c) 2014-2016 PatientSky A/S\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n","_id":"@a2software/formsy-react@1.1.5","dist":{"shasum":"f41a7442293607dd9b278d836f8fe09b81681469","integrity":"sha512-0aZn10rXB7F4nt3WzvAi9mYSE1GbCncdT2GXadfOLX/6I3Y9d0bmWpA1YTrwFVX7QPNKLtRtg6FO3qJyM+7U6Q==","tarball":"https://registry.npmjs.org/@a2software/formsy-react/-/formsy-react-1.1.5.tgz","fileCount":10,"unpackedSize":47506,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcvF+1CRA9TVsSAnZWagAAVlYP/it7xMECJU01JChlNydx\nc6BxR+DxUcdqKX17CDPp1ubXvf08HQCsiWfChCENkHYyw0xNdYffNFJEPURl\nPeeHezXqg6dzUfdBgif0wvTBzyWXqjptEgRQCjAYZTYBOo3OmETEgC+XgGuH\naBeB62MsN8RdSx8b8wwMEKXG9+Hb0/cxWBxp0dMxvboDvqwPDpzdAZhtBNHp\n3pIPb+rppVZ5wNCPbvtjid/QC0Du3pW1lTnx5Lo1KIfVUyx9H6Mh0hlSDUrU\nDL08zwQy50SoNljTAWUpBpxs9zoI6jWrHv/P8I2Pi3vPAXm3z2MUfmLzL6MD\nT1Rot1yB6KnA8BZyZx053Gq6BJo1xXsqKpouSzp+o+Ygfhfvg2Gf3sCJsIq9\n3svpEjDY5sg+bVgopwUT+7tqfLgNRBK64d6C68mdSrEcKvN13NVWOUQQ1DDk\nRHqtGocJPC9bjeBgm/piOX0Si+d/Wtcx+FqEuw2OXTTtv0MAWShgDe1AcJxk\nmErGRfd0WHZt7rR+SOZH0d+0nbrlhioz5wc3Rimf8JQmCxwcxPuamEPs3fPd\nCp+DOV5g8eTD6eSxhN2wnNH8gdVDYAOlkRXWcQrZa24kdPnexyGuYlOV9XBp\nm3aj/oT5pULDymSh7goeAEObmgaVUAABbuqn74dbqSkop8d/LD3ILwjNerb+\n0iqr\r\n=/SvP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDZuMPoKF2k714eTvlhAhWXnYauI9HhfvOH1fJLljw3jQIgeA+lOSA+Klj0TV3IpNX694jUxnOprb3ORt/1byuiALM="}]},"maintainers":[{"name":"amrmostafa","email":"amr.mostafa@gmail.com"}],"_npmUser":{"name":"amrmostafa","email":"amr.mostafa@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/formsy-react_1.1.5_1555849140778_0.8595707496632718"},"_hasShrinkwrap":false}},"time":{"created":"2019-04-21T12:18:06.681Z","1.0.0":"2019-04-21T12:18:07.059Z","modified":"2022-04-04T10:53:00.402Z","1.1.5":"2019-04-21T12:19:00.928Z"},"maintainers":[{"name":"amrmostafa","email":"amr.mostafa@gmail.com"}],"description":"A form input builder and validator for React","homepage":"https://github.com/amr/formsy-react","keywords":["form","forms","formsy","react","react-component","validation"],"repository":{"type":"git","url":"https://github.com/amr/formsy-react.git"},"author":{"name":"Christian Alfoni"},"bugs":{"url":"https://github.com/amr/formsy-react/issues"},"license":"MIT","readme":"# formsy-react \n\n[![GitHub release](https://img.shields.io/github/release/formsy/formsy-react.svg)](https://github.com/formsy/formsy-react/releases)\n[![Build status](https://travis-ci.org/formsy/formsy-react.svg?branch=master)](https://travis-ci.org/formsy/formsy-react)\n[![Gzipped size](http://img.badgesize.io/https://unpkg.com/formsy-react?compression=gzip)](https://unpkg.com/formsy-react)\n[![Gitter chat](https://badges.gitter.im/formsy.png)](https://gitter.im/formsy/Lobby)\n\n## This fork\n\nIt has those PRs:\n* https://github.com/formsy/formsy-react/pull/126\n\n\nA form input builder and validator for React.\n\n| [Quick Start](#quick-start) | [API](/API.md) | [Examples](/examples) |\n| --------------------------- | -------------- | --------------------- |\n\n## Background\n\n[christianalfoni](https://github.com/christianalfoni/) wrote an article on forms and validation with React, [Nailing that validation with React JS](http://christianalfoni.github.io/javascript/2014/10/22/nailing-that-validation-with-reactjs.html), the result of that was this component.\n\nThe main concept is that forms, inputs, and validation are done very differently across developers and projects. This React component aims to be that “sweet spot” between flexibility and reusability.\n\nThis project was originally located at https://github.com/christianalfoni/formsy-react if you're looking for v0.x or old issues.\n\n## What You Can Do\n\n1.  Build any kind of form element components. Not just traditional inputs, but anything you want, and get that validation for free\n2.  Add validation rules and use them with simple syntax\n3.  Use handlers for different states of your form. (`onError`, `onSubmit`, `onValid`, etc.)\n4.  Pass external errors to the form to invalidate elements (E.g. a response from a server)\n5.  Dynamically add form elements to your form and they will register/unregister to the form\n\n## Install\n\n`yarn add formsy-react react react-dom` and use with webpack, browserify, etc.\n\n## Quick Start\n\n### 1. Build a Formsy element\n\n```jsx\n// MyInput.js\nimport { withFormsy } from 'formsy-react';\nimport React from 'react';\n\nclass MyInput extends React.Component {\n  constructor(props) {\n    super(props);\n    this.changeValue = this.changeValue.bind(this);\n  }\n\n  changeValue(event) {\n    // setValue() will set the value of the component, which in\n    // turn will validate it and the rest of the form\n    // Important: Don't skip this step. This pattern is required\n    // for Formsy to work.\n    this.props.setValue(event.currentTarget.value);\n  }\n\n  render() {\n    // An error message is returned only if the component is invalid\n    const errorMessage = this.props.getErrorMessage();\n\n    return (\n      <div>\n        <input\n          onChange={this.changeValue}\n          type=\"text\"\n          value={this.props.getValue() || ''}\n        />\n        <span>{errorMessage}</span>\n      </div>\n    );\n  }\n}\n\nexport default withFormsy(MyInput);\n```\n\n`withFormsy` is a [Higher-Order Component](https://facebook.github.io/react/docs/higher-order-components.html) that exposes additional props to `MyInput`. See the [API](/API.md#withFormsy) documentation to view a complete list of the props.\n\n### 2. Use your Formsy element\n\n```jsx\nimport Formsy from 'formsy-react';\nimport React from 'react';\nimport MyInput from './MyInput';\n\nexport default class App extends React.Component {\n  constructor(props) {\n    super(props);\n    this.disableButton = this.disableButton.bind(this);\n    this.enableButton = this.enableButton.bind(this);\n    this.state = { canSubmit: false };\n  }\n\n  disableButton() {\n    this.setState({ canSubmit: false });\n  }\n\n  enableButton() {\n    this.setState({ canSubmit: true });\n  }\n\n  submit(model) {\n    fetch('http://example.com/', {\n      method: 'post',\n      body: JSON.stringify(model)\n    });\n  }\n\n  render() {\n    return (\n      <Formsy onValidSubmit={this.submit} onValid={this.enableButton} onInvalid={this.disableButton}>\n        <MyInput\n          name=\"email\"\n          validations=\"isEmail\"\n          validationError=\"This is not a valid email\"\n          required\n        />\n        <button type=\"submit\" disabled={!this.state.canSubmit}>Submit</button>\n      </Formsy>\n    );\n  }\n}\n```\n\nThis code results in a form with a submit button that will run the `submit` method when the form is submitted with a valid email. The submit button is disabled as long as the input is empty ([required](/API.md#required)) and the value is not an email ([isEmail](/API.md#validators)). On validation error it will show the message: \"This is not a valid email\".\n\n## Formsy component packages\n\n-   https://github.com/twisty/formsy-react-components, Bootstrap 3 compatible form fields\n-   https://github.com/zabute/formsy-semantic-ui-react, Semantic UI form fields\n-   https://github.com/gogoair/react-formsy-combo-select, wrapper for https://github.com/gogoair/react-combo-select\n-   https://github.com/rojobuffalo/formsy-material-ui, Material-UI form fields (out of date, for formsy-react 0.x)\n\n## Contribute\n\n-   Fork repo\n-   `yarn`\n-   `yarn examples` runs the development server on `localhost:8080`\n-   `yarn test` runs the tests\n\n\n## Changelog\n\n[Check out releases](https://github.com/formsy/formsy-react/releases)\n\n## License\n\n[The MIT License (MIT)](/LICENSE)\n\nCopyright (c) 2014-2016 PatientSky A/S\n","readmeFilename":"README.md"}