@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.cjs CHANGED
@@ -2457,22 +2457,8 @@ class Form {
2457
2457
  throw new Error('form is read-only');
2458
2458
  }
2459
2459
 
2460
- const formFieldRegistry = this.get('formFieldRegistry');
2461
- const data = formFieldRegistry.getAll().reduce((data, field) => {
2462
- const {
2463
- disabled,
2464
- _path
2465
- } = field; // do not submit disabled form fields
2466
-
2467
- if (disabled || !_path) {
2468
- return data;
2469
- }
2460
+ const data = this._getSubmitData();
2470
2461
 
2471
- const value = minDash.get(this._getState().data, _path);
2472
- return { ...data,
2473
- [_path[0]]: value
2474
- };
2475
- }, {});
2476
2462
  const errors = this.validate();
2477
2463
 
2478
2464
  this._emit('submit', {
@@ -2691,6 +2677,29 @@ class Form {
2691
2677
  _onEvent(type, priority, handler) {
2692
2678
  this.get('eventBus').on(type, priority, handler);
2693
2679
  }
2680
+ /**
2681
+ * @internal
2682
+ */
2683
+
2684
+
2685
+ _getSubmitData() {
2686
+ const formFieldRegistry = this.get('formFieldRegistry');
2687
+ return formFieldRegistry.getAll().reduce((data, field) => {
2688
+ const {
2689
+ disabled,
2690
+ _path
2691
+ } = field; // do not submit disabled form fields
2692
+
2693
+ if (disabled || !_path) {
2694
+ return data;
2695
+ }
2696
+
2697
+ const value = minDash.get(this._getState().data, _path);
2698
+ return { ...data,
2699
+ [_path[0]]: value
2700
+ };
2701
+ }, {});
2702
+ }
2694
2703
 
2695
2704
  }
2696
2705