@websy/websy-designs 2.0.0 → 2.0.1

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.
@@ -3041,7 +3041,7 @@ class MultiForm {
3041
3041
  `
3042
3042
  newFormEl.innerHTML = html
3043
3043
  el.appendChild(newFormEl)
3044
- let formOptions = Object.assign({}, this.options, { fields: [...this.options.fields.map(f => Object.assign({}, f))] })
3044
+ let formOptions = Object.assign({}, this.options, { rowIndex: this.forms.length, fields: [...this.options.fields.map(f => Object.assign({}, f, { rowIndex: this.forms.length }))] })
3045
3045
  this.forms.push(new WebsyDesigns.Form(`${this.elementId}_${newId}_form`, formOptions))
3046
3046
  if (addEl) {
3047
3047
  addEl.style.display = this.forms.length < this.options.maxRows ? 'flex' : 'none'
@@ -3129,7 +3129,17 @@ class MultiForm {
3129
3129
  el.innerHTML = html
3130
3130
  this.forms = new Array(this.formData.length)
3131
3131
  this.formData.forEach((d, i) => {
3132
- let formOptions = Object.assign({}, this.options, { fields: [...this.options.fields.map(f => Object.assign({}, f))] })
3132
+ let formOptions = Object.assign({}, this.options, {
3133
+ rowIndex: i,
3134
+ fields: [...this.options.fields.map(f => {
3135
+ const newF = Object.assign({}, f)
3136
+ if (!newF.options) {
3137
+ newF.options = {}
3138
+ }
3139
+ newF.options.rowIndex = i
3140
+ return newF
3141
+ })]
3142
+ })
3133
3143
  let formObject = new WebsyDesigns.Form(`${this.elementId}_${d.formId}_form`, formOptions)
3134
3144
  formObject.data = d
3135
3145
  this.forms[i] = formObject