@rjsf/core 5.21.0 → 5.21.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -42,6 +42,7 @@ var import_utils39 = require("@rjsf/utils");
42
42
  var import_forEach = __toESM(require("lodash/forEach"));
43
43
  var import_get4 = __toESM(require("lodash/get"));
44
44
  var import_isEmpty2 = __toESM(require("lodash/isEmpty"));
45
+ var import_isNil = __toESM(require("lodash/isNil"));
45
46
  var import_pick = __toESM(require("lodash/pick"));
46
47
  var import_toPath = __toESM(require("lodash/toPath"));
47
48
 
@@ -1650,6 +1651,7 @@ function SchemaFieldRender(props) {
1650
1651
  (_schema2) => schemaUtils.retrieveSchema((0, import_isObject4.default)(_schema2) ? _schema2 : {}, formData)
1651
1652
  ),
1652
1653
  registry,
1654
+ required,
1653
1655
  schema,
1654
1656
  uiSchema
1655
1657
  }
@@ -1674,6 +1676,7 @@ function SchemaFieldRender(props) {
1674
1676
  (_schema2) => schemaUtils.retrieveSchema((0, import_isObject4.default)(_schema2) ? _schema2 : {}, formData)
1675
1677
  ),
1676
1678
  registry,
1679
+ required,
1677
1680
  schema,
1678
1681
  uiSchema
1679
1682
  }
@@ -3320,7 +3323,6 @@ var Form = class extends import_react17.Component {
3320
3323
  const mustValidate = !noValidate && liveValidate;
3321
3324
  let state = { formData, schema };
3322
3325
  let newFormData = formData;
3323
- let _retrievedSchema;
3324
3326
  if (omitExtraData === true && liveOmit === true) {
3325
3327
  newFormData = this.omitExtraData(formData);
3326
3328
  state = {
@@ -3357,9 +3359,6 @@ var Form = class extends import_react17.Component {
3357
3359
  errors: (0, import_utils39.toErrorList)(errorSchema)
3358
3360
  };
3359
3361
  }
3360
- if (_retrievedSchema) {
3361
- state.retrievedSchema = _retrievedSchema;
3362
- }
3363
3362
  this.setState(state, () => onChange && onChange({ ...this.state, ...state }, id));
3364
3363
  };
3365
3364
  /**
@@ -3718,17 +3717,17 @@ var Form = class extends import_react17.Component {
3718
3717
  if (resolvedSchema?.type !== "object" && resolvedSchema?.type !== "array") {
3719
3718
  filteredErrors.__errors = schemaErrors.__errors;
3720
3719
  }
3721
- const filterUndefinedErrors = (errors) => {
3720
+ const filterNilOrEmptyErrors = (errors) => {
3722
3721
  (0, import_forEach.default)(errors, (errorAtKey, errorKey) => {
3723
- if (errorAtKey === void 0) {
3722
+ if ((0, import_isNil.default)(errorAtKey)) {
3724
3723
  delete errors[errorKey];
3725
3724
  } else if (typeof errorAtKey === "object" && !Array.isArray(errorAtKey.__errors)) {
3726
- filterUndefinedErrors(errorAtKey);
3725
+ filterNilOrEmptyErrors(errorAtKey);
3727
3726
  }
3728
3727
  });
3729
3728
  return errors;
3730
3729
  };
3731
- return filterUndefinedErrors(filteredErrors);
3730
+ return filterNilOrEmptyErrors(filteredErrors);
3732
3731
  }
3733
3732
  /** Returns the registry for the form */
3734
3733
  getRegistry() {