@uform/core
Advanced tools
Comparing version 1.0.0-alpha.6 to 1.0.0-alpha.7
@@ -61,3 +61,2 @@ "use strict"; | ||
exports.FormGraph = graph_1.FormGraph; | ||
var scheduler_1 = require("./shared/scheduler"); | ||
var form_1 = require("./state/form"); | ||
@@ -221,3 +220,3 @@ var virtual_field_1 = require("./state/virtual-field"); | ||
}, true); | ||
}, false); | ||
}); | ||
} | ||
@@ -758,4 +757,4 @@ if (unmountedChanged && | ||
} | ||
heart.publish(types_1.LifeCycleTypes.ON_FORM_SUBMIT, state); | ||
if (shared_1.isFn(onSubmit)) { | ||
heart.publish(types_1.LifeCycleTypes.ON_FORM_SUBMIT, state); | ||
return Promise.resolve(onSubmit(state.getState(function (state) { return shared_1.clone(state.values); }))).then(function (payload) { return ({ validated: validated, payload: payload }); }); | ||
@@ -959,3 +958,3 @@ } | ||
}); | ||
var applyWithScheduler = scheduler_1.scheduler(options.validateConcurrentTimeMS); | ||
var applyWithScheduler = shared_1.scheduler(options.validateConcurrentTimeMS); | ||
var formApi = { | ||
@@ -962,0 +961,0 @@ submit: submit, |
{ | ||
"name": "@uform/core", | ||
"version": "1.0.0-alpha.6", | ||
"version": "1.0.0-alpha.7", | ||
"license": "MIT", | ||
@@ -29,5 +29,5 @@ "main": "lib", | ||
"dependencies": { | ||
"@uform/shared": "^1.0.0-alpha.6", | ||
"@uform/shared": "^1.0.0-alpha.7", | ||
"@uform/types": "^0.4.0", | ||
"@uform/validator": "^1.0.0-alpha.6", | ||
"@uform/validator": "^1.0.0-alpha.7", | ||
"immer": "^3.2.0" | ||
@@ -38,3 +38,3 @@ }, | ||
}, | ||
"gitHead": "a6ce0cd7ff509e241f7a14287bb5795f410da353" | ||
"gitHead": "ce5f31583ee0d29077e9fb162988e6f0b259e4eb" | ||
} |
@@ -12,3 +12,4 @@ import { | ||
each, | ||
isObj | ||
isObj, | ||
scheduler | ||
} from '@uform/shared' | ||
@@ -23,3 +24,2 @@ import { | ||
import { FormGraph } from './shared/graph' | ||
import { scheduler } from './shared/scheduler' | ||
import { FormState } from './state/form' | ||
@@ -207,16 +207,12 @@ import { VirtualFieldState } from './state/virtual-field' | ||
} | ||
graph.eachChildren( | ||
path, | ||
childState => { | ||
childState.setState((state: IFieldState<FieldProps>) => { | ||
if (visibleChanged) { | ||
state.visible = published.visible | ||
} | ||
if (displayChanged) { | ||
state.display = published.display | ||
} | ||
}, true) | ||
}, | ||
false | ||
) | ||
graph.eachChildren(path, childState => { | ||
childState.setState((state: IFieldState<FieldProps>) => { | ||
if (visibleChanged) { | ||
state.visible = published.visible | ||
} | ||
if (displayChanged) { | ||
state.display = published.display | ||
} | ||
}, true) | ||
}) | ||
} | ||
@@ -808,4 +804,4 @@ if ( | ||
} | ||
heart.publish(LifeCycleTypes.ON_FORM_SUBMIT, state) | ||
if (isFn(onSubmit)) { | ||
heart.publish(LifeCycleTypes.ON_FORM_SUBMIT, state) | ||
return Promise.resolve( | ||
@@ -812,0 +808,0 @@ onSubmit(state.getState(state => clone(state.values))) |
220466
29
4679