@bolttech/form-engine-core 0.0.3-beta.2 → 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.
- package/index.esm.js +8 -5
- package/package.json +1 -1
package/index.esm.js
CHANGED
|
@@ -3040,7 +3040,7 @@ class FormField {
|
|
|
3040
3040
|
this.errorSubject$.unsubscribe();
|
|
3041
3041
|
this.apiSubject$.unsubscribe();
|
|
3042
3042
|
this.apiEventQueueSubject$.unsubscribe();
|
|
3043
|
-
this.formValidNotification$.next({
|
|
3043
|
+
!this.formValidNotification$.closed && this.formValidNotification$.next({
|
|
3044
3044
|
fieldTrigger: this.name
|
|
3045
3045
|
});
|
|
3046
3046
|
}
|
|
@@ -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
|
}
|
|
@@ -3963,12 +3966,12 @@ class FormCore {
|
|
|
3963
3966
|
this.submitSubject$.next(values);
|
|
3964
3967
|
}
|
|
3965
3968
|
destroy() {
|
|
3966
|
-
this.fields.forEach(field => field.destroyField());
|
|
3967
3969
|
this.submitSubject$.unsubscribe();
|
|
3968
3970
|
this.templateSubscription$.unsubscribe();
|
|
3969
3971
|
this.fieldEventSubject$.unsubscribe();
|
|
3970
3972
|
this.dataSubject$.unsubscribe();
|
|
3971
3973
|
this.formValidNotification$.unsubscribe();
|
|
3974
|
+
this.fields.forEach(field => field.destroyField());
|
|
3972
3975
|
}
|
|
3973
3976
|
}
|
|
3974
3977
|
/**
|