@bpmn-io/form-js-viewer 0.9.7 → 0.9.9

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.
package/dist/index.es.js CHANGED
@@ -2445,22 +2445,8 @@ class Form {
2445
2445
  throw new Error('form is read-only');
2446
2446
  }
2447
2447
 
2448
- const formFieldRegistry = this.get('formFieldRegistry');
2449
- const data = formFieldRegistry.getAll().reduce((data, field) => {
2450
- const {
2451
- disabled,
2452
- _path
2453
- } = field; // do not submit disabled form fields
2454
-
2455
- if (disabled || !_path) {
2456
- return data;
2457
- }
2448
+ const data = this._getSubmitData();
2458
2449
 
2459
- const value = get(this._getState().data, _path);
2460
- return { ...data,
2461
- [_path[0]]: value
2462
- };
2463
- }, {});
2464
2450
  const errors = this.validate();
2465
2451
 
2466
2452
  this._emit('submit', {
@@ -2679,6 +2665,29 @@ class Form {
2679
2665
  _onEvent(type, priority, handler) {
2680
2666
  this.get('eventBus').on(type, priority, handler);
2681
2667
  }
2668
+ /**
2669
+ * @internal
2670
+ */
2671
+
2672
+
2673
+ _getSubmitData() {
2674
+ const formFieldRegistry = this.get('formFieldRegistry');
2675
+ return formFieldRegistry.getAll().reduce((data, field) => {
2676
+ const {
2677
+ disabled,
2678
+ _path
2679
+ } = field; // do not submit disabled form fields
2680
+
2681
+ if (disabled || !_path) {
2682
+ return data;
2683
+ }
2684
+
2685
+ const value = get(this._getState().data, _path);
2686
+ return { ...data,
2687
+ [_path[0]]: value
2688
+ };
2689
+ }, {});
2690
+ }
2682
2691
 
2683
2692
  }
2684
2693