@websy/websy-designs 1.12.2 → 1.12.4

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.
@@ -2498,7 +2498,7 @@ class WebsyForm {
2498
2498
  }
2499
2499
  for (let key in d) {
2500
2500
  this.options.fields.forEach(f => {
2501
- if (f.field === key) {
2501
+ if (f.field === key && d[key]) {
2502
2502
  this.setValue(key, d[key])
2503
2503
  // f.value = d[key]
2504
2504
  // const el = document.getElementById(`${this.elementId}_input_${f.field}`)
@@ -3094,7 +3094,7 @@ class MultiForm {
3094
3094
  el.remove()
3095
3095
  }
3096
3096
  const addEl = document.getElementById(`${this.elementId}_addButton`)
3097
- if (addEl) {
3097
+ if (addEl && this.options.allowAdd) {
3098
3098
  addEl.style.display = (typeof this.options.maxRows === 'undefined' || this.forms.length < this.options.maxRows) ? 'flex' : 'none'
3099
3099
  }
3100
3100
  // delete form element based on id
@@ -2477,7 +2477,7 @@ var WebsyForm = /*#__PURE__*/function () {
2477
2477
  }
2478
2478
  var _loop = function _loop(key) {
2479
2479
  _this18.options.fields.forEach(function (f) {
2480
- if (f.field === key) {
2480
+ if (f.field === key && d[key]) {
2481
2481
  _this18.setValue(key, d[key]);
2482
2482
  // f.value = d[key]
2483
2483
  // const el = document.getElementById(`${this.elementId}_input_${f.field}`)
@@ -3059,7 +3059,7 @@ var MultiForm = /*#__PURE__*/function () {
3059
3059
  el.remove();
3060
3060
  }
3061
3061
  var addEl = document.getElementById("".concat(this.elementId, "_addButton"));
3062
- if (addEl) {
3062
+ if (addEl && this.options.allowAdd) {
3063
3063
  addEl.style.display = typeof this.options.maxRows === 'undefined' || this.forms.length < this.options.maxRows ? 'flex' : 'none';
3064
3064
  }
3065
3065
  // delete form element based on id