@felte/react
Advanced tools
Comparing version 1.0.0-next.21 to 1.0.0-next.22
@@ -0,1 +1,2 @@ | ||
import { __rest } from './external/.pnpm/tslib@2.3.1/external/tslib/tslib.es6.js'; | ||
import { _mapValues } from './packages/common/dist/esm/utils/mapValues.js'; | ||
@@ -11,3 +12,6 @@ import { _isPlainObject } from './packages/common/dist/esm/utils/isPlainObject.js'; | ||
return value; | ||
return prop.map((p) => deepSetTouched(p, value)); | ||
return prop.map((p) => { | ||
const _a = deepSetTouched(p, value), field = __rest(_a, ["key"]); | ||
return field; | ||
}); | ||
} | ||
@@ -14,0 +18,0 @@ return value; |
import { get } from './get.js'; | ||
import { deepSetTouched } from './deep-set-touched.js'; | ||
import { deepSetKey } from './deep-set-key.js'; | ||
import { _get } from './packages/common/dist/esm/utils/get.js'; | ||
@@ -9,2 +10,3 @@ import { _set } from './packages/common/dist/esm/utils/set.js'; | ||
import { deepSet } from './packages/common/dist/esm/utils/deepSet.js'; | ||
import { createId } from './packages/common/dist/esm/utils/createId.js'; | ||
import { _update } from './packages/common/dist/esm/utils/update.js'; | ||
@@ -49,3 +51,3 @@ import { _cloneDeep } from './packages/common/dist/esm/utils/cloneDeep.js'; | ||
let formNode; | ||
let initialValues = ((_a = config.initialValues) !== null && _a !== void 0 ? _a : {}); | ||
let initialValues = deepSetKey(((_a = config.initialValues) !== null && _a !== void 0 ? _a : {})); | ||
const { data, touched, errors, warnings, isDirty, isSubmitting } = stores; | ||
@@ -69,2 +71,3 @@ const setData = createSetHelper(data.update); | ||
setTouched(pathOrValue, true); | ||
isDirty.set(true); | ||
} | ||
@@ -96,2 +99,3 @@ }; | ||
: []; | ||
value = _isPlainObject(value) ? Object.assign(Object.assign({}, value), { key: createId() }) : value; | ||
errors.update(($errors) => { | ||
@@ -164,3 +168,3 @@ return addAtIndex($errors, path, errValue, index); | ||
setInitialValues: (values) => { | ||
initialValues = values; | ||
initialValues = deepSetKey(values); | ||
}, | ||
@@ -167,0 +171,0 @@ }; |
@@ -0,1 +1,2 @@ | ||
import { __rest } from '../external/.pnpm/tslib@2.3.1/external/tslib/tslib.es6.js'; | ||
import { _mapValues } from './mapValues.js'; | ||
@@ -6,4 +7,6 @@ import { _isPlainObject } from './isPlainObject.js'; | ||
return function (propVal) { | ||
if (_isPlainObject(propVal)) | ||
return deepSet(propVal, value); | ||
if (_isPlainObject(propVal)) { | ||
const _a = deepSet(propVal, value), field = __rest(_a, ["key"]); | ||
return field; | ||
} | ||
return value; | ||
@@ -10,0 +13,0 @@ }; |
import { deepSetTouched } from './deep-set-touched.js'; | ||
import { deepSetKey } from './deep-set-key.js'; | ||
import { executeTransforms } from './packages/common/dist/esm/utils/executeTransforms.js'; | ||
@@ -118,3 +119,3 @@ import { _cloneDeep } from './packages/common/dist/esm/utils/cloneDeep.js'; | ||
const initialValues = config.initialValues | ||
? executeTransforms(_cloneDeep(config.initialValues), config.transform) | ||
? deepSetKey(executeTransforms(_cloneDeep(config.initialValues), config.transform)) | ||
: {}; | ||
@@ -121,0 +122,0 @@ const initialTouched = deepSetTouched(initialValues, false); |
{ | ||
"name": "@felte/react", | ||
"version": "1.0.0-next.21", | ||
"version": "1.0.0-next.22", | ||
"description": "An extensible form library for ReactJS", | ||
@@ -29,3 +29,3 @@ "main": "dist/cjs/index.js", | ||
"dependencies": { | ||
"@felte/core": "1.0.0-next.18" | ||
"@felte/core": "1.0.0-next.19" | ||
}, | ||
@@ -39,3 +39,3 @@ "publishConfig": { | ||
"devDependencies": { | ||
"@felte/common": "1.0.0-next.15", | ||
"@felte/common": "1.0.0-next.16", | ||
"@testing-library/jest-dom": "^5.11.9", | ||
@@ -42,0 +42,0 @@ "@testing-library/react": "^12.1.2", |
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
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
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
464353
82
3521
+ Added@felte/common@1.0.0-next.16(transitive)
+ Added@felte/core@1.0.0-next.19(transitive)
- Removed@felte/common@1.0.0-next.15(transitive)
- Removed@felte/core@1.0.0-next.18(transitive)
Updated@felte/core@1.0.0-next.19