@uform/core
Advanced tools
Comparing version 1.0.0-beta.6 to 1.0.0-rc.0
@@ -370,3 +370,3 @@ "use strict"; | ||
else { | ||
state.value = shared_1.isValid(formValue) ? formValue : initialValue; | ||
state.value = existFormValuesIn(dataPath) ? formValue : initialValue; | ||
} | ||
@@ -519,2 +519,7 @@ state.initialValue = shared_1.isValid(initialValue) | ||
} | ||
function existFormValuesIn(path) { | ||
return state.getState(function (state) { | ||
return shared_1.FormPath.existIn(state.values, transformDataPath(path)); | ||
}); | ||
} | ||
function getFormInitialValuesIn(path) { | ||
@@ -521,0 +526,0 @@ return getFormIn(path, 'initialValues'); |
@@ -148,6 +148,6 @@ "use strict"; | ||
prevState.initialized && | ||
!shared_1.isEqual(draft.value, prevState.value)) { | ||
!shared_1.isEqual(prevState.value, draft.value)) { | ||
draft.modified = true; | ||
} | ||
if (shared_1.isEqual(draft.value, draft.initialValue)) { | ||
if (shared_1.isEqual(draft.initialValue, draft.value)) { | ||
draft.pristine = true; | ||
@@ -154,0 +154,0 @@ } |
@@ -27,3 +27,3 @@ "use strict"; | ||
} | ||
if (shared_1.isEqual(draft.values, draft.initialValues)) { | ||
if (shared_1.isEqual(draft.initialValues, draft.values)) { | ||
draft.pristine = true; | ||
@@ -30,0 +30,0 @@ } |
{ | ||
"name": "@uform/core", | ||
"version": "1.0.0-beta.6", | ||
"version": "1.0.0-rc.0", | ||
"license": "MIT", | ||
@@ -29,4 +29,4 @@ "main": "lib", | ||
"dependencies": { | ||
"@uform/shared": "^1.0.0-beta.6", | ||
"@uform/validator": "^1.0.0-beta.6", | ||
"@uform/shared": "^1.0.0-rc.0", | ||
"@uform/validator": "^1.0.0-rc.0", | ||
"immer": "^3.2.0" | ||
@@ -37,3 +37,3 @@ }, | ||
}, | ||
"gitHead": "3426348f0fc6f0b3cc32635b393487243d6a3bf0" | ||
"gitHead": "d66cee79ee61c227f5beaac446b83c37b143ee42" | ||
} |
@@ -43,3 +43,3 @@ # @uform/core | ||
- [IMutators](#imutators) | ||
- [Validation](#the-validator) | ||
- [Validation](#validation) | ||
- [IFormState](#iformstate) | ||
@@ -721,3 +721,3 @@ - [IFieldState](#ifieldstate) | ||
value: any, | ||
rescription?: ValidateDescription | ||
description?: ValidateDescription | ||
) => ValidateResponse | ||
@@ -724,0 +724,0 @@ type SyncValidateResponse = |
@@ -41,3 +41,3 @@ # @uform/core | ||
- [IMutators](#imutators) | ||
- [Validator](#validator) | ||
- [Validation](#validation) | ||
- [IFormState](#iformstate) | ||
@@ -739,3 +739,3 @@ - [IFieldState](#ifieldstate) | ||
#### Validator | ||
#### Validation | ||
@@ -747,3 +747,3 @@ > 这里主要列举校验相关的中间类型签名 | ||
value: any, | ||
rescription?: ValidateDescription | ||
description?: ValidateDescription | ||
) => ValidateResponse | ||
@@ -750,0 +750,0 @@ type SyncValidateResponse = |
@@ -393,3 +393,3 @@ import { | ||
} else { | ||
state.value = isValid(formValue) ? formValue : initialValue | ||
state.value = existFormValuesIn(dataPath) ? formValue : initialValue | ||
} | ||
@@ -571,2 +571,8 @@ // initialValue > formInitialValue | ||
function existFormValuesIn(path: FormPathPattern) { | ||
return state.getState(state => | ||
FormPath.existIn(state.values, transformDataPath(path)) | ||
) | ||
} | ||
function getFormInitialValuesIn(path: FormPathPattern) { | ||
@@ -573,0 +579,0 @@ return getFormIn(path, 'initialValues') |
@@ -197,7 +197,7 @@ import { createStateModel } from '../shared/model' | ||
prevState.initialized && | ||
!isEqual(draft.value, prevState.value) | ||
!isEqual(prevState.value, draft.value) | ||
) { | ||
draft.modified = true | ||
} | ||
if (isEqual(draft.value, draft.initialValue)) { | ||
if (isEqual(draft.initialValue, draft.value)) { | ||
draft.pristine = true | ||
@@ -204,0 +204,0 @@ } else { |
@@ -53,3 +53,3 @@ import { createStateModel } from '../shared/model' | ||
} | ||
if (isEqual(draft.values, draft.initialValues)) { | ||
if (isEqual(draft.initialValues, draft.values)) { | ||
draft.pristine = true | ||
@@ -56,0 +56,0 @@ } else { |
AI-detected possible typosquat
Supply chain riskAI has identified this package as a potential typosquat of a more popular package. This suggests that the package may be intentionally mimicking another package's name, description, or other metadata.
Found 1 instance in 1 package
228148
4821
1
Updated@uform/shared@^1.0.0-rc.0
Updated@uform/validator@^1.0.0-rc.0