formsy-react
Advanced tools
Comparing version 2.0.0-beta.8 to 2.0.0
@@ -7,2 +7,16 @@ ### Changelog | ||
#### [v2.0.0-beta.8](https://github.com/formsy/formsy-react/compare/v2.0.0-beta.7...v2.0.0-beta.8) | ||
> 30 January 2020 | ||
- Edit types to parameterize value. Edit validations rules to apply to specific types [`#341`](https://github.com/formsy/formsy-react/pull/341) | ||
- Rewrite isSame to not use circular imports, remove arraysDiffer, objectsDiffer, find [`#362`](https://github.com/formsy/formsy-react/pull/362) | ||
- Dependabot Automatic Library Bumps [`#363`](https://github.com/formsy/formsy-react/pull/363) | ||
- Edit validation function type to add string type (for error message) [`#339`](https://github.com/formsy/formsy-react/pull/339) | ||
- Add cloneIfObject utility to reduce code duplication [`#337`](https://github.com/formsy/formsy-react/pull/337) | ||
- Dependabot Automatic Library Bumps [`#338`](https://github.com/formsy/formsy-react/pull/338) | ||
- bug-fix: Improve performance, prevent redundant exponential data copy [`#317`](https://github.com/formsy/formsy-react/pull/317) | ||
- Fix deprecated lifecycle method usage in tests [`#318`](https://github.com/formsy/formsy-react/pull/318) | ||
- Apply automatic code formatting [`9952dfe`](https://github.com/formsy/formsy-react/commit/9952dfe04eb0cdc749d7ef033fc53b73be08dd1c) | ||
#### [v2.0.0-beta.7](https://github.com/formsy/formsy-react/compare/v2.0.0-beta.6...v2.0.0-beta.7) | ||
@@ -9,0 +23,0 @@ |
@@ -5,3 +5,3 @@ import React from 'react'; | ||
import Wrapper, { propTypes } from './Wrapper'; | ||
import { IModel, InputComponent, IResetModel, ISetInputValue, IUpdateInputsWithError, ValidationFunction } from './interfaces'; | ||
import { IModel, InputComponent, IResetModel, IUpdateInputsWithValue, IUpdateInputsWithError, ValidationFunction } from './interfaces'; | ||
declare type FormHTMLAttributesCleaned = Omit<React.FormHTMLAttributes<HTMLFormElement>, 'onChange' | 'onSubmit'>; | ||
@@ -105,3 +105,2 @@ export interface FormsyProps extends FormHTMLAttributesCleaned { | ||
resetModel: IResetModel; | ||
setValue: ISetInputValue<any>; | ||
runValidation: <V>(component: InputComponent<V>, value?: V) => { | ||
@@ -117,2 +116,3 @@ isRequired: boolean; | ||
updateInputsWithError: IUpdateInputsWithError; | ||
updateInputsWithValue: IUpdateInputsWithValue<any>; | ||
validate: <V>(component: InputComponent<V>) => void; | ||
@@ -119,0 +119,0 @@ validateForm: () => void; |
@@ -9,3 +9,3 @@ import React, { ComponentClass } from 'react'; | ||
export declare type IResetModel = (model?: IModel) => void; | ||
export declare type ISetInputValue<V> = (name: string, value: V, validate?: boolean) => void; | ||
export declare type IUpdateInputsWithValue<V> = (values: any, validate?: boolean) => void; | ||
export declare type IUpdateInputsWithError = (errors: any, invalidate?: boolean) => void; | ||
@@ -12,0 +12,0 @@ export declare type ValidationFunction<V> = (values: Values, value: V, extra?: any) => boolean | string; |
{ | ||
"name": "formsy-react", | ||
"version": "2.0.0-beta.8", | ||
"version": "2.0.0", | ||
"description": "A form input builder and validator for React", | ||
@@ -24,2 +24,7 @@ "keywords": [ | ||
"jest": { | ||
"collectCoverage": true, | ||
"collectCoverageFrom": [ | ||
"src/**/*.tsx", | ||
"src/**/*.ts" | ||
], | ||
"transform": { | ||
@@ -61,2 +66,3 @@ "^.+\\.(js|jsx|ts|tsx)$": "babel-jest" | ||
"dependencies": { | ||
"coveralls": "^3.0.9", | ||
"form-data-to-object": "^0.2.0", | ||
@@ -63,0 +69,0 @@ "prop-types": "^15.7.2" |
@@ -5,2 +5,3 @@ # formsy-react | ||
[![Build status](https://travis-ci.org/formsy/formsy-react.svg?branch=master)](https://travis-ci.org/formsy/formsy-react) | ||
[![Coverage Status](https://coveralls.io/repos/github/formsy/formsy-react/badge.svg?branch=master)](https://coveralls.io/github/formsy/formsy-react?branch=master) | ||
[![Gzipped size](http://img.badgesize.io/https://unpkg.com/formsy-react?compression=gzip)](https://unpkg.com/formsy-react) | ||
@@ -11,4 +12,4 @@ [![Gitter](https://badges.gitter.im/formsy/Lobby.svg)](https://gitter.im/formsy/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) | ||
| [Quick Start](#quick-start) | [API](/API.md) | | ||
| --------------------------- | -------------- | | ||
| [Quick Start](#quick-start) | [API](/API.md) | [1.x API](https://github.com/formsy/formsy-react/blob/v1.x/API.md) | | ||
| --------------------------- | -------------- | ------------------------------------------------------------------ | | ||
@@ -41,14 +42,7 @@ | ||
## Join the 2.x beta | ||
## 1.x to 2.x Upgrade Guide | ||
The 2.0 release is currently in active development on master, but not yet released publicly. The API docs are still | ||
written for the 1.x branch and will remain that way until release. However, the API changes are minor and listed below. | ||
If you'd like to upgrade to formsy 2.x you can run: | ||
The 2.0 release fixed a number of legacy decisions in the Formsy API, mostly a reliance on function props over value | ||
props passed down to wrapped components. However, the API changes are minor and listed below. | ||
``` | ||
yarn upgrade formsy-react@2.0.0-beta.3 | ||
``` | ||
**Element prop breaking changes:** | ||
- `getErrorMessage()` => `errorMessage` | ||
@@ -90,8 +84,8 @@ - `getErrorMessages()` => `errorMessages` | ||
render() { | ||
// An error message is returned only if the component is invalid | ||
const errorMessage = this.props.getErrorMessage(); | ||
// An error message is passed only if the component is invalid | ||
const errorMessage = this.props.errorMessage; | ||
return ( | ||
<div> | ||
<input onChange={this.changeValue} type="text" value={this.props.getValue() || ''} /> | ||
<input onChange={this.changeValue} type="text" value={this.props.value || ''} /> | ||
<span>{errorMessage}</span> | ||
@@ -160,5 +154,5 @@ </div> | ||
- https://github.com/twisty/formsy-react-components, Bootstrap 3 compatible form fields | ||
- https://github.com/zabute/formsy-semantic-ui-react, Semantic UI form fields | ||
- https://github.com/gogoair/react-formsy-combo-select, wrapper for https://github.com/gogoair/react-combo-select | ||
- https://github.com/rojobuffalo/formsy-material-ui, Material-UI form fields (out of date, for formsy-react 0.x) | ||
- https://github.com/zabute/formsy-semantic-ui-react, Semantic UI form fields (out of date, for formsy-react 1.x) | ||
- https://github.com/gogoair/react-formsy-combo-select, wrapper for https://github.com/gogoair/react-combo-select (out | ||
of date, for formsy-react 1.x) | ||
@@ -175,3 +169,4 @@ ## Contribute | ||
[Check out releases](https://github.com/formsy/formsy-react/releases) | ||
Check out our [Changelog](https://github.com/formsy/formsy-react/blob/master/CHANGELOG.md) and | ||
[releases](https://github.com/formsy/formsy-react/releases) | ||
@@ -178,0 +173,0 @@ ## License |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
772718
6805
0
5
170
+ Addedcoveralls@^3.0.9
+ Addedajv@6.12.6(transitive)
+ Addedargparse@1.0.10(transitive)
+ Addedasn1@0.2.6(transitive)
+ Addedassert-plus@1.0.0(transitive)
+ Addedasynckit@0.4.0(transitive)
+ Addedaws-sign2@0.7.0(transitive)
+ Addedaws4@1.13.2(transitive)
+ Addedbcrypt-pbkdf@1.0.2(transitive)
+ Addedcaseless@0.12.0(transitive)
+ Addedcombined-stream@1.0.8(transitive)
+ Addedcore-util-is@1.0.2(transitive)
+ Addedcoveralls@3.1.1(transitive)
+ Addeddashdash@1.14.1(transitive)
+ Addeddelayed-stream@1.0.0(transitive)
+ Addedecc-jsbn@0.1.2(transitive)
+ Addedesprima@4.0.1(transitive)
+ Addedextend@3.0.2(transitive)
+ Addedextsprintf@1.3.0(transitive)
+ Addedfast-deep-equal@3.1.3(transitive)
+ Addedfast-json-stable-stringify@2.1.0(transitive)
+ Addedforever-agent@0.6.1(transitive)
+ Addedform-data@2.3.3(transitive)
+ Addedgetpass@0.1.7(transitive)
+ Addedhar-schema@2.0.0(transitive)
+ Addedhar-validator@5.1.5(transitive)
+ Addedhttp-signature@1.2.0(transitive)
+ Addedis-typedarray@1.0.0(transitive)
+ Addedisstream@0.1.2(transitive)
+ Addedjs-yaml@3.14.1(transitive)
+ Addedjsbn@0.1.1(transitive)
+ Addedjson-schema@0.4.0(transitive)
+ Addedjson-schema-traverse@0.4.1(transitive)
+ Addedjson-stringify-safe@5.0.1(transitive)
+ Addedjsprim@1.4.2(transitive)
+ Addedlcov-parse@1.0.0(transitive)
+ Addedlog-driver@1.2.7(transitive)
+ Addedmime-db@1.52.0(transitive)
+ Addedmime-types@2.1.35(transitive)
+ Addedminimist@1.2.8(transitive)
+ Addedoauth-sign@0.9.0(transitive)
+ Addedperformance-now@2.1.0(transitive)
+ Addedpsl@1.10.0(transitive)
+ Addedpunycode@2.3.1(transitive)
+ Addedqs@6.5.3(transitive)
+ Addedrequest@2.88.2(transitive)
+ Addedsafe-buffer@5.2.1(transitive)
+ Addedsafer-buffer@2.1.2(transitive)
+ Addedsprintf-js@1.0.3(transitive)
+ Addedsshpk@1.18.0(transitive)
+ Addedtough-cookie@2.5.0(transitive)
+ Addedtunnel-agent@0.6.0(transitive)
+ Addedtweetnacl@0.14.5(transitive)
+ Addeduri-js@4.4.1(transitive)
+ Addeduuid@3.4.0(transitive)
+ Addedverror@1.10.0(transitive)