cerebral-forms
Advanced tools
Comparing version 1.0.0-b-alpha.547405cb to 1.0.0-b-alpha.54e312b7
@@ -24,3 +24,3 @@ 'use strict'; | ||
exports.default = [(0, _operators.set)((0, _tags.state)(_templateObject, (0, _tags.input)(_templateObject2)), (0, _tags.input)(_templateObject3)), (0, _validateField2.default)((0, _tags.state)(_templateObject4, (0, _tags.input)(_templateObject2)))]; | ||
exports.default = [(0, _operators.set)((0, _tags.state)(_templateObject, (0, _tags.props)(_templateObject2)), (0, _tags.props)(_templateObject3)), (0, _validateField2.default)((0, _tags.state)(_templateObject4, (0, _tags.props)(_templateObject2)))]; | ||
//# sourceMappingURL=changeField.js.map |
@@ -17,3 +17,3 @@ 'use strict'; | ||
path = _ref.path, | ||
resolveArg = _ref.resolveArg; | ||
resolve = _ref.resolve; | ||
@@ -31,7 +31,7 @@ if (typeof formPath === 'string') { | ||
} else { | ||
if (!resolveArg.isTag(formPath, 'state')) { | ||
if (!resolve.isTag(formPath, 'state')) { | ||
throw new Error('Cerebral Forms - isValidForm factory requires a STATE TAG'); | ||
} | ||
var _form = resolveArg.value(formPath); | ||
var _form = resolve.value(formPath); | ||
@@ -38,0 +38,0 @@ if ((0, _isValidForm2.default)(_form)) { |
@@ -45,3 +45,3 @@ 'use strict'; | ||
var state = _ref.state, | ||
resolveArg = _ref.resolveArg; | ||
resolve = _ref.resolve; | ||
@@ -55,9 +55,9 @@ if (typeof formPath === 'string') { | ||
} else { | ||
if (!resolveArg.isTag(formPath, 'state')) { | ||
if (!resolve.isTag(formPath, 'state')) { | ||
throw new Error('Cerebral Forms - isValidForm factory requires a STATE TAG'); | ||
} | ||
var _form = resolveArg.value(formPath); | ||
var _form = resolve.value(formPath); | ||
state.merge(resolveArg.path(formPath), resetObject(_form)); | ||
state.merge(resolve.path(formPath), resetObject(_form)); | ||
} | ||
@@ -64,0 +64,0 @@ } |
@@ -17,3 +17,3 @@ 'use strict'; | ||
var state = _ref.state, | ||
resolveArg = _ref.resolveArg; | ||
resolve = _ref.resolve; | ||
@@ -26,7 +26,7 @@ var path = void 0; | ||
} else { | ||
if (!resolveArg.isTag(fieldPath, 'state')) { | ||
if (!resolve.isTag(fieldPath, 'state')) { | ||
throw new Error('Cerebral Forms - validateField factory requires a STATE TAG'); | ||
} | ||
path = resolveArg.path(fieldPath); | ||
path = resolve.path(fieldPath); | ||
} | ||
@@ -37,3 +37,3 @@ | ||
var field = state.get(path); | ||
var form = state.get(formPath); | ||
var form = state.get(formPath.join('.')); | ||
var validationResult = (0, _runValidation2.default)(field, form); | ||
@@ -40,0 +40,0 @@ |
@@ -17,4 +17,4 @@ 'use strict'; | ||
var state = _ref.state, | ||
input = _ref.input, | ||
resolveArg = _ref.resolveArg; | ||
props = _ref.props, | ||
resolve = _ref.resolve; | ||
@@ -44,7 +44,7 @@ function validate(path, form) { | ||
} else { | ||
if (!resolveArg.isTag(formPath, 'state')) { | ||
if (!resolve.isTag(formPath, 'state')) { | ||
throw new Error('Cerebral Forms - validateField factory requires a STATE TAG'); | ||
} | ||
validate(resolveArg.path(formPath).split('.'), resolveArg.value(formPath)); | ||
validate(resolve.path(formPath).split('.'), resolve.value(formPath)); | ||
} | ||
@@ -51,0 +51,0 @@ } |
{ | ||
"name": "cerebral-forms", | ||
"version": "1.0.0-b-alpha.547405cb", | ||
"version": "1.0.0-b-alpha.54e312b7", | ||
"description": "Signals, actions and state factories to create forms", | ||
@@ -28,7 +28,7 @@ "main": "lib/index.js", | ||
"peerDependencies": { | ||
"cerebral": "^2.0.0-b-alpha.547405cb" | ||
"cerebral": "2.0.0-b-alpha.54e312b7" | ||
}, | ||
"devDependencies": { | ||
"@cerebral/monorepo": "^0.0.1-alpha.547405cb", | ||
"cerebral": "^2.0.0-b-alpha.547405cb" | ||
"@cerebral/monorepo": "0.0.1-alpha.54e312b7", | ||
"cerebral": "2.0.0-b-alpha.54e312b7" | ||
}, | ||
@@ -35,0 +35,0 @@ "nyc": { |
@@ -203,3 +203,3 @@ # cerebral-forms | ||
```js | ||
import {input} from 'cerebral/operators' | ||
import {props} from 'cerebral/tags' | ||
import {validateField} from 'cerebral-forms' | ||
@@ -212,3 +212,3 @@ | ||
// dynamic | ||
validateField(input`fieldPath`), | ||
validateField(props`fieldPath`), | ||
doThat | ||
@@ -222,3 +222,3 @@ ] | ||
```js | ||
import {input} from 'cerebral/operators' | ||
import {props} from 'cerebral/tags' | ||
import {validateForm} from 'cerebral-forms' | ||
@@ -230,3 +230,3 @@ | ||
// dynamic | ||
validateForm(input`formPath`), | ||
validateForm(props`formPath`), | ||
isFormValid, { | ||
@@ -247,3 +247,3 @@ true: [ | ||
```js | ||
import {input} from 'cerebral/operators' | ||
import {props} from 'cerebral/tags' | ||
import {resetForm} from 'cerebral-forms' | ||
@@ -256,3 +256,3 @@ | ||
// dynamic | ||
resetForm(input`formPath`), | ||
resetForm(props`formPath`), | ||
doThat | ||
@@ -348,3 +348,3 @@ ] | ||
```js | ||
import {input} from 'cerebral/operators' | ||
import {props} from 'cerebral/tags' | ||
import {isValidForm} from 'cerebral-forms' | ||
@@ -356,3 +356,3 @@ | ||
// dynamic | ||
isValidForm(input`formPath`), { | ||
isValidForm(props`formPath`), { | ||
true: [], | ||
@@ -359,0 +359,0 @@ false: [] |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
72256