@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.
|
@@ -2293,7 +2293,7 @@ class WebsyForm {
|
|
|
2293
2293
|
}
|
|
2294
2294
|
for (let key in d) {
|
|
2295
2295
|
this.options.fields.forEach(f => {
|
|
2296
|
-
if (f.field === key) {
|
|
2296
|
+
if (f.field === key && d[key]) {
|
|
2297
2297
|
this.setValue(key, d[key])
|
|
2298
2298
|
// f.value = d[key]
|
|
2299
2299
|
// const el = document.getElementById(`${this.elementId}_input_${f.field}`)
|
|
@@ -2889,7 +2889,7 @@ class MultiForm {
|
|
|
2889
2889
|
el.remove()
|
|
2890
2890
|
}
|
|
2891
2891
|
const addEl = document.getElementById(`${this.elementId}_addButton`)
|
|
2892
|
-
if (addEl) {
|
|
2892
|
+
if (addEl && this.options.allowAdd) {
|
|
2893
2893
|
addEl.style.display = (typeof this.options.maxRows === 'undefined' || this.forms.length < this.options.maxRows) ? 'flex' : 'none'
|
|
2894
2894
|
}
|
|
2895
2895
|
// delete form element based on id
|
|
@@ -2298,7 +2298,7 @@ var WebsyForm = /*#__PURE__*/function () {
|
|
|
2298
2298
|
}
|
|
2299
2299
|
var _loop = function _loop(key) {
|
|
2300
2300
|
_this16.options.fields.forEach(function (f) {
|
|
2301
|
-
if (f.field === key) {
|
|
2301
|
+
if (f.field === key && d[key]) {
|
|
2302
2302
|
_this16.setValue(key, d[key]);
|
|
2303
2303
|
// f.value = d[key]
|
|
2304
2304
|
// const el = document.getElementById(`${this.elementId}_input_${f.field}`)
|
|
@@ -2880,7 +2880,7 @@ var MultiForm = /*#__PURE__*/function () {
|
|
|
2880
2880
|
el.remove();
|
|
2881
2881
|
}
|
|
2882
2882
|
var addEl = document.getElementById("".concat(this.elementId, "_addButton"));
|
|
2883
|
-
if (addEl) {
|
|
2883
|
+
if (addEl && this.options.allowAdd) {
|
|
2884
2884
|
addEl.style.display = typeof this.options.maxRows === 'undefined' || this.forms.length < this.options.maxRows ? 'flex' : 'none';
|
|
2885
2885
|
}
|
|
2886
2886
|
// delete form element based on id
|