@rjsf/core
Advanced tools
Comparing version 5.13.0 to 5.13.1
@@ -94,4 +94,18 @@ import { __rest } from "tslib"; | ||
} | ||
const { onChange } = this.props; | ||
const { onChange, errorSchema } = this.props; | ||
const { keyedFormData } = this.state; | ||
// refs #195: revalidate to ensure properly reindexing errors | ||
let newErrorSchema; | ||
if (errorSchema) { | ||
newErrorSchema = {}; | ||
for (const idx in errorSchema) { | ||
const i = parseInt(idx); | ||
if (i <= index) { | ||
set(newErrorSchema, [i], errorSchema[idx]); | ||
} | ||
else if (i > index) { | ||
set(newErrorSchema, [i + 1], errorSchema[idx]); | ||
} | ||
} | ||
} | ||
const newKeyedFormDataRow = { | ||
@@ -111,3 +125,3 @@ key: generateRowId(), | ||
updatedKeyedFormData: true, | ||
}, () => onChange(keyedToPlainFormData(newKeyedFormData))); | ||
}, () => onChange(keyedToPlainFormData(newKeyedFormData), newErrorSchema)); | ||
}; | ||
@@ -308,4 +322,18 @@ }; | ||
} | ||
const { onChange } = this.props; | ||
const { onChange, errorSchema } = this.props; | ||
const { keyedFormData } = this.state; | ||
// refs #195: revalidate to ensure properly reindexing errors | ||
let newErrorSchema; | ||
if (errorSchema) { | ||
newErrorSchema = {}; | ||
for (const idx in errorSchema) { | ||
const i = parseInt(idx); | ||
if (index === undefined || i < index) { | ||
set(newErrorSchema, [i], errorSchema[idx]); | ||
} | ||
else if (i >= index) { | ||
set(newErrorSchema, [i + 1], errorSchema[idx]); | ||
} | ||
} | ||
} | ||
const newKeyedFormDataRow = { | ||
@@ -325,3 +353,3 @@ key: generateRowId(), | ||
updatedKeyedFormData: true, | ||
}, () => onChange(keyedToPlainFormData(newKeyedFormData))); | ||
}, () => onChange(keyedToPlainFormData(newKeyedFormData), newErrorSchema)); | ||
} | ||
@@ -328,0 +356,0 @@ /** Renders the `ArrayField` depending on the specific needs of the schema and uischema elements |
{ | ||
"name": "@rjsf/core", | ||
"version": "5.13.0", | ||
"version": "5.13.1", | ||
"description": "A simple React component capable of building HTML forms out of a JSON schema.", | ||
@@ -52,24 +52,24 @@ "scripts": { | ||
"devDependencies": { | ||
"@babel/core": "^7.22.9", | ||
"@babel/core": "^7.22.17", | ||
"@babel/plugin-proposal-class-properties": "^7.18.6", | ||
"@babel/plugin-proposal-optional-chaining": "^7.21.0", | ||
"@babel/preset-env": "^7.22.9", | ||
"@babel/preset-react": "^7.22.5", | ||
"@babel/preset-typescript": "^7.22.5", | ||
"@rjsf/utils": "^5.13.0", | ||
"@rjsf/validator-ajv6": "^5.13.0", | ||
"@rjsf/validator-ajv8": "^5.13.0", | ||
"@types/lodash": "^4.14.196", | ||
"@types/react": "^17.0.62", | ||
"@babel/preset-env": "^7.22.15", | ||
"@babel/preset-react": "^7.22.15", | ||
"@babel/preset-typescript": "^7.22.15", | ||
"@rjsf/utils": "^5.13.1", | ||
"@rjsf/validator-ajv6": "^5.13.1", | ||
"@rjsf/validator-ajv8": "^5.13.1", | ||
"@types/lodash": "^4.14.198", | ||
"@types/react": "^17.0.65", | ||
"@types/react-dom": "^17.0.20", | ||
"@types/react-test-renderer": "^17.0.2", | ||
"@types/react-test-renderer": "^17.0.3", | ||
"ajv": "^8.12.0", | ||
"atob": "^2.1.2", | ||
"babel-jest": "^29.6.2", | ||
"babel-jest": "^29.6.4", | ||
"chai": "^3.5.0", | ||
"esbuild": "^0.18.19", | ||
"eslint": "^8.46.0", | ||
"esbuild": "^0.18.20", | ||
"eslint": "^8.48.0", | ||
"html": "^1.0.0", | ||
"jest": "^29.6.2", | ||
"jest-environment-jsdom": "^29.6.1", | ||
"jest": "^29.6.4", | ||
"jest-environment-jsdom": "^29.6.4", | ||
"jsdom": "^20.0.3", | ||
@@ -82,3 +82,3 @@ "mocha": "^10.2.0", | ||
"rimraf": "^5.0.1", | ||
"rollup": "^3.27.2", | ||
"rollup": "^3.29.0", | ||
"sinon": "^9.2.4", | ||
@@ -108,3 +108,3 @@ "typescript": "^4.9.5" | ||
}, | ||
"gitHead": "588b1c063095f75278585838cbca9b20252e13c9" | ||
"gitHead": "a8039b4b7b872606a14e28885ba4e7faea9e2bfa" | ||
} |
Sorry, the diff of this file is too big to display
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 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
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
1404928
19515