@bolttech/form-engine-core 0.0.3-beta.3 → 0.0.3-beta.4

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 +6 -3
  2. package/package.json +1 -1
package/index.esm.js CHANGED
@@ -3125,9 +3125,11 @@ class FormCore {
3125
3125
  */
3126
3126
  const initialValues = entry.initialValues || ((_k = entry.schema) === null || _k === void 0 ? void 0 : _k.initialValues);
3127
3127
  this.fields.forEach((field, key) => {
3128
+ var _a;
3128
3129
  if (!initialValues || initialValues && !Object.keys(initialValues).includes(key)) {
3130
+ const propValue = (_a = field === null || field === void 0 ? void 0 : field.props) === null || _a === void 0 ? void 0 : _a[(field === null || field === void 0 ? void 0 : field.valuePropName) || ''];
3129
3131
  !(field === null || field === void 0 ? void 0 : field.value) && (field === null || field === void 0 ? void 0 : field.emitValue({
3130
- value: '',
3132
+ value: typeof propValue === 'string' && !propValue.includes('${') ? propValue : '',
3131
3133
  event: 'ON_FIELD_MOUNT'
3132
3134
  }));
3133
3135
  }
@@ -3713,7 +3715,7 @@ class FormCore {
3713
3715
  fieldSchema,
3714
3716
  mapperElement
3715
3717
  }) {
3716
- var _a;
3718
+ var _a, _b;
3717
3719
  if (this.fields.has(fieldSchema.name)) {
3718
3720
  throw new Error(`field name ${fieldSchema.name} already defined`);
3719
3721
  }
@@ -3740,8 +3742,9 @@ class FormCore {
3740
3742
  });
3741
3743
  if (!this.queuedInitialValues.has(fieldSchema.name)) {
3742
3744
  const field = this.fields.get(fieldSchema.name);
3745
+ const propValue = (_b = field === null || field === void 0 ? void 0 : field.props) === null || _b === void 0 ? void 0 : _b[(field === null || field === void 0 ? void 0 : field.valuePropName) || ''];
3743
3746
  !(field === null || field === void 0 ? void 0 : field.value) && (field === null || field === void 0 ? void 0 : field.emitValue({
3744
- value: '',
3747
+ value: typeof propValue === 'string' && !propValue.includes('${') ? propValue : '',
3745
3748
  event: 'ON_FIELD_MOUNT'
3746
3749
  }));
3747
3750
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bolttech/form-engine-core",
3
- "version": "0.0.3-beta.3",
3
+ "version": "0.0.3-beta.4",
4
4
  "module": "./index.esm.js",
5
5
  "type": "module",
6
6
  "main": "./index.esm.js",