@bolttech/form-engine 3.0.0-beta.22 → 3.0.0-beta.23

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.
Files changed (2) hide show
  1. package/index.esm.js +19 -2
  2. package/package.json +2 -2
package/index.esm.js CHANGED
@@ -2485,7 +2485,7 @@ const Form = ({
2485
2485
  */
2486
2486
  return () => {
2487
2487
  removeForm({
2488
- key: index
2488
+ key: schemaIndex
2489
2489
  });
2490
2490
  };
2491
2491
  }, []);
@@ -2518,9 +2518,26 @@ const Form = ({
2518
2518
  */
2519
2519
  useEffect(() => {
2520
2520
  if (iVars) getForm({
2521
- key: index
2521
+ key: schemaIndex
2522
2522
  }).iVars = iVars;
2523
2523
  }, [iVars]);
2524
+ /**
2525
+ * initialValues setter for async initialValues
2526
+ */
2527
+ useEffect(() => {
2528
+ const form = getForm({
2529
+ key: schemaIndex
2530
+ });
2531
+ if (initialValues && form) {
2532
+ Object.keys(initialValues).forEach(fieldName => {
2533
+ var _a;
2534
+ (_a = form.fields.get(fieldName)) === null || _a === void 0 ? void 0 : _a.emitValue({
2535
+ event: 'ON_FORM_SUBMIT',
2536
+ value: initialValues[fieldName]
2537
+ });
2538
+ });
2539
+ }
2540
+ }, [initialValues]);
2524
2541
  /**
2525
2542
  * hook usage to keep event bindings updated on callback functions passed as props
2526
2543
  */
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@bolttech/form-engine",
3
- "version": "3.0.0-beta.22",
3
+ "version": "3.0.0-beta.23",
4
4
  "description": "A react adapter for bolttech form engine",
5
5
  "module": "./index.esm.js",
6
6
  "type": "module",
7
7
  "main": "./index.esm.js",
8
8
  "dependencies": {
9
- "@bolttech/form-engine-core": "0.0.1-beta.13",
9
+ "@bolttech/form-engine-core": "0.0.1-beta.14",
10
10
  "react": "18.2.0"
11
11
  },
12
12
  "peerDependencies": {}