Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

calidation

Package Overview
Dependencies
Maintainers
1
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

calidation - npm Package Compare versions

Comparing version 1.15.0 to 1.15.1

11

dist/Validation.js

@@ -168,2 +168,3 @@ (function (global, factory) {

fields = _props2.fields,
isValid = _props2.isValid,
resetAll = _props2.resetAll,

@@ -179,2 +180,3 @@ setError = _props2.setError,

fields: fields,
isValid: isValid,
resetAll: resetAll,

@@ -202,5 +204,6 @@ setError: setError,

// FormContext
dirty: (0, _propTypes.shape)({}),
errors: (0, _propTypes.shape)({}),
fields: (0, _propTypes.shape)({}),
dirty: (0, _propTypes.shape)({}).isRequired,
errors: (0, _propTypes.shape)({}).isRequired,
fields: (0, _propTypes.shape)({}).isRequired,
isValid: _propTypes.bool.isRequired,
register: _propTypes.func.isRequired,

@@ -211,3 +214,3 @@ resetAll: _propTypes.func.isRequired,

submit: _propTypes.func.isRequired,
submitted: _propTypes.bool,
submitted: _propTypes.bool.isRequired,
unregister: _propTypes.func.isRequired

@@ -214,0 +217,0 @@ });

{
"name": "calidation",
"version": "1.15.0",
"version": "1.15.1",
"description": "A red hot validation library for React",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

@@ -404,2 +404,20 @@ # calidation

#### Context
The `FormContext` object represents the core internal state of the form and is passed through event callbacks and into template functions.
```js
{
dirty: object, // Object with all fields isDirty state, keyed per field
errors: object, // Object with all error messages, keyed per field
fields: object, // Object with all field inputs, keyed per field
isValid: bool, // Boolean indicating whether your form is valid or not
resetAll: func, // call this to programmatically trigger a full state reset
setError: func, // callback accepting a diff object, updating errors like setState
setField: func, // callback accepting a diff object, updating fields like setState
submit: func, // call this to programmatically trigger a submitted state
submitted: bool, // flag showing whether the form has been submitted once or not
}
```
### `Form`

@@ -434,18 +452,4 @@

The `onSubmit` function is called with an object with the following props:
The `onSubmit` function is called with the `FormContext` object as its only prop.
```js
{
dirty: object, // Object with all fields isDirty state, keyed per field
errors: object, // Object with all error messages, keyed per field
fields: object, // Object with all field inputs, keyed per field
isValid: bool, // Boolean indicating whether your form is valid or not
resetAll: func, // call this to programmatically trigger a full state reset
setError: func, // callback accepting a diff object, updating errors like setState
setField: func, // callback accepting a diff object, updating fields like setState
submit: func, // call this to programmatically trigger a submitted state
submitted: bool, // flag showing whether the form has been submitted once or not
}
```
##### `onUpdate: func`

@@ -457,18 +461,4 @@

The `onUpdate` function is called with an object with the follow props:
The `onUpdate` function is called with the `FormContext` object as its only prop.
```js
{
dirty: object, // Object with all fields isDirty state, keyed per field
errors: object, // Object with all error messages, keyed per field
fields: object, // Object with all field inputs, keyed per field
isValid: bool, // Boolean indicating whether your form is valid or not
resetAll: func, // call this to programmatically trigger a full state reset
setError: func, // callback accepting a diff object, updating errors like setState
setField: func, // callback accepting a diff object, updating fields like setState
submit: func, // call this to programmatically trigger a submitted state
submitted: bool, // flag showing whether the form has been submitted once or not
}
```
### `Validation`

@@ -485,17 +475,4 @@

The `children` function is called with an object with the following props:
The `children` function is called with the `FormContext` object as its only prop.
```js
{
dirty: object, // Object with all fields isDirty state, keyed per field
errors: object, // object with the same keys as `fields`, but with error messages
fields: object, // object with the form field values, to make controlled components
resetAll: func, // call this to programmatically trigger a full state reset
setError: func, // callback accepting a diff object, updating errors like setState
setField: func, // callback accepting a diff object, updating fields like setState
submit: func, // call this to programmatically trigger a submitted state
submitted: bool, // flag showing whether the form has been submitted once or not
}
```
##### `config: object.isRequired`

@@ -502,0 +479,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc