jedison 1.11.0 → 1.11.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.
@@ -2052,6 +2052,13 @@ class Instance extends EventEmitter {
2052
2052
  if (!this.isActive) {
2053
2053
  return [];
2054
2054
  }
2055
+ let ancestor = this.parent;
2056
+ while (ancestor) {
2057
+ if (!ancestor.isActive) {
2058
+ return [];
2059
+ }
2060
+ ancestor = ancestor.parent;
2061
+ }
2055
2062
  return removeDuplicatesFromArray(
2056
2063
  this.jedison.validator.getErrors(this.getValueRaw(), this.originalSchema, this.getKey(), this.path)
2057
2064
  );
@@ -3046,7 +3053,9 @@ class InstanceObject extends Instance {
3046
3053
  this.value = value;
3047
3054
  this.jedison.emit("instance-change", this, initiator);
3048
3055
  this.emit("change", initiator);
3049
- this.emit("notifyParent", initiator);
3056
+ if (!this.refreshingInstances) {
3057
+ this.emit("notifyParent", initiator);
3058
+ }
3050
3059
  }
3051
3060
  /**
3052
3061
  * Sorts the children of the current instance based on their `propertyOrder` value in ascending order.
@@ -3076,8 +3085,11 @@ class InstanceObject extends Instance {
3076
3085
  });
3077
3086
  }
3078
3087
  refreshInstances(initiator) {
3088
+ const wasRefreshing = this.refreshingInstances;
3089
+ this.refreshingInstances = true;
3079
3090
  const value = this.getValue();
3080
3091
  if (!isObject(value)) {
3092
+ this.refreshingInstances = wasRefreshing;
3081
3093
  return;
3082
3094
  }
3083
3095
  const childMap = /* @__PURE__ */ new Map();
@@ -3112,6 +3124,7 @@ class InstanceObject extends Instance {
3112
3124
  }
3113
3125
  this.sortChildrenByPropertyOrder();
3114
3126
  this.value = value;
3127
+ this.refreshingInstances = wasRefreshing;
3115
3128
  }
3116
3129
  }
3117
3130
  class InstanceArray extends Instance {
@@ -5423,7 +5436,8 @@ class EditorMultiple extends Editor {
5423
5436
  if (this.embedSwitcher) {
5424
5437
  this.control.header.style.display = "none";
5425
5438
  }
5426
- this.instance.on("change", () => {
5439
+ this.instance.on("change", (initiator) => {
5440
+ if (initiator === "api") return;
5427
5441
  const jedison = this.instance.jedison;
5428
5442
  const errors = jedison.getErrors(["error", "warning"]);
5429
5443
  const prefix = this.instance.path + "/";