@formio/js 5.1.0-dev.6154.73887de → 5.1.0-dev.6156.9cd5779

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.
@@ -228,6 +228,9 @@ class DataMapComponent extends DataGrid_1.default {
228
228
  options.name += `[${rowIndex}]`;
229
229
  options.row = `${rowIndex}`;
230
230
  options.rowIndex = rowIndex;
231
+ options.onChange = (flags, changed, modified) => {
232
+ this.triggerChange({ modified });
233
+ };
231
234
  const components = {};
232
235
  components['__key'] = this.createComponent(this.keySchema, options, { __key: this.builderMode ? this.defaultRowKey : key });
233
236
  components['__key'].on('componentChange', (event) => {
@@ -243,7 +246,9 @@ class DataMapComponent extends DataGrid_1.default {
243
246
  valueComponent.key = key;
244
247
  const componentOptions = this.options;
245
248
  componentOptions.row = options.row;
246
- components[this.valueKey] = this.createComponent(valueComponent, componentOptions, this.dataValue);
249
+ const componentOptionsCloned = lodash_1.default.clone(componentOptions);
250
+ componentOptionsCloned.onChange = options.onChange;
251
+ components[this.valueKey] = this.createComponent(valueComponent, componentOptionsCloned, this.dataValue);
247
252
  return components;
248
253
  }
249
254
  get canAddColumn() {
@@ -266,7 +271,7 @@ class DataMapComponent extends DataGrid_1.default {
266
271
  const index = this.rows.length;
267
272
  this.rows[index] = this.createRowComponents(this.dataValue, index);
268
273
  this.redraw();
269
- this.triggerChange();
274
+ this.triggerChange({ modified: true });
270
275
  }
271
276
  removeRow(index) {
272
277
  const keys = Object.keys(this.dataValue);
@@ -223,6 +223,9 @@ export default class DataMapComponent extends DataGridComponent {
223
223
  options.name += `[${rowIndex}]`;
224
224
  options.row = `${rowIndex}`;
225
225
  options.rowIndex = rowIndex;
226
+ options.onChange = (flags, changed, modified) => {
227
+ this.triggerChange({ modified });
228
+ };
226
229
  const components = {};
227
230
  components['__key'] = this.createComponent(this.keySchema, options, { __key: this.builderMode ? this.defaultRowKey : key });
228
231
  components['__key'].on('componentChange', (event) => {
@@ -238,7 +241,9 @@ export default class DataMapComponent extends DataGridComponent {
238
241
  valueComponent.key = key;
239
242
  const componentOptions = this.options;
240
243
  componentOptions.row = options.row;
241
- components[this.valueKey] = this.createComponent(valueComponent, componentOptions, this.dataValue);
244
+ const componentOptionsCloned = _.clone(componentOptions);
245
+ componentOptionsCloned.onChange = options.onChange;
246
+ components[this.valueKey] = this.createComponent(valueComponent, componentOptionsCloned, this.dataValue);
242
247
  return components;
243
248
  }
244
249
  get canAddColumn() {
@@ -261,7 +266,7 @@ export default class DataMapComponent extends DataGridComponent {
261
266
  const index = this.rows.length;
262
267
  this.rows[index] = this.createRowComponents(this.dataValue, index);
263
268
  this.redraw();
264
- this.triggerChange();
269
+ this.triggerChange({ modified: true });
265
270
  }
266
271
  removeRow(index) {
267
272
  const keys = Object.keys(this.dataValue);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@formio/js",
3
- "version": "5.1.0-dev.6154.73887de",
3
+ "version": "5.1.0-dev.6156.9cd5779",
4
4
  "description": "JavaScript powered Forms with JSON Form Builder",
5
5
  "main": "lib/cjs/index.js",
6
6
  "exports": {