jedison 1.3.1 → 1.3.3

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.
@@ -2091,12 +2091,10 @@ class Editor {
2091
2091
  if (neverShowErrors && !force || errors.length === 0) {
2092
2092
  return;
2093
2093
  }
2094
- let counter = 0;
2095
2094
  errors.forEach((error) => {
2096
2095
  if (error.constraint === "properties") {
2097
2096
  return;
2098
2097
  }
2099
- counter += 1;
2100
2098
  error.messages.forEach((message) => {
2101
2099
  let invalidFeedback;
2102
2100
  if (error.type === "error") {
@@ -2111,7 +2109,7 @@ class Editor {
2111
2109
  this.control.messages.appendChild(invalidFeedback);
2112
2110
  });
2113
2111
  });
2114
- this.showingValidationErrors = counter > 0;
2112
+ this.showingValidationErrors = true;
2115
2113
  }
2116
2114
  /**
2117
2115
  * Get an error message container
@@ -4204,7 +4202,8 @@ class EditorArrayTableObject extends EditorArray {
4204
4202
  if (arrayButtonsPosition === "left") {
4205
4203
  table.thead.appendChild(th);
4206
4204
  }
4207
- if (this.instance.getValue().length === 0) {
4205
+ const value = this.instance.getValue();
4206
+ if (!isArray(value) || value.length === 0) {
4208
4207
  table.table.removeChild(table.thead);
4209
4208
  }
4210
4209
  let schemaItems = getSchemaItems(this.instance.schema);
@@ -4339,7 +4338,7 @@ class EditorArrayChoices extends Editor {
4339
4338
  this.choices = itemEnum.map((item, index2) => ({
4340
4339
  value: item,
4341
4340
  label: itemEnumTitles[index2] || item,
4342
- selected: value.includes(item)
4341
+ selected: isArray(value) && value.includes(item)
4343
4342
  }));
4344
4343
  this.choicesInstance = new window.Choices(this.control.input, {
4345
4344
  duplicateItemsAllowed: false,
@@ -4918,7 +4917,10 @@ class EditorArrayCheckboxes extends Editor {
4918
4917
  addEventListeners() {
4919
4918
  this.control.checkboxes.forEach((checkbox) => {
4920
4919
  checkbox.addEventListener("change", () => {
4921
- const value = this.instance.getValue();
4920
+ let value = this.instance.getValue();
4921
+ if (!isArray(value)) {
4922
+ value = [];
4923
+ }
4922
4924
  if (checkbox.checked) {
4923
4925
  value.push(checkbox.value);
4924
4926
  } else {
@@ -4934,6 +4936,9 @@ class EditorArrayCheckboxes extends Editor {
4934
4936
  refreshUI() {
4935
4937
  this.refreshDisabledState();
4936
4938
  const value = this.instance.getValue();
4939
+ if (!isArray(value)) {
4940
+ return;
4941
+ }
4937
4942
  this.control.checkboxes.forEach((checkbox) => {
4938
4943
  checkbox.checked = value.includes(checkbox.value);
4939
4944
  });