kwikid-forms 0.6.1 → 0.6.3
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/fesm2015/kwikid-forms.js
CHANGED
|
@@ -3109,9 +3109,36 @@ class KwikIDFormViewComponent {
|
|
|
3109
3109
|
});
|
|
3110
3110
|
}
|
|
3111
3111
|
handleOnClickFormFieldButton(field) {
|
|
3112
|
+
let formData = this.formGroup.getRawValue();
|
|
3113
|
+
for (let field of this.formFields) {
|
|
3114
|
+
if (field.isFormElement) {
|
|
3115
|
+
if (field.hidden) {
|
|
3116
|
+
delete formData[field.key];
|
|
3117
|
+
}
|
|
3118
|
+
else {
|
|
3119
|
+
formData[field.key] = convertFormFieldValueToStandardFormat(field, formData[field.key]);
|
|
3120
|
+
}
|
|
3121
|
+
}
|
|
3122
|
+
}
|
|
3123
|
+
const extendedFormData = this.formFields.reduce((result, field, index) => {
|
|
3124
|
+
if (field.isFormElement && !field.hidden) {
|
|
3125
|
+
const fieldData = {
|
|
3126
|
+
[field.key]: {
|
|
3127
|
+
key: field.key,
|
|
3128
|
+
label: field.label,
|
|
3129
|
+
value: isEmptyValue(formData[field.key]) ? "" : formData[field.key],
|
|
3130
|
+
type: field.type,
|
|
3131
|
+
index: index
|
|
3132
|
+
}
|
|
3133
|
+
};
|
|
3134
|
+
result[field.key] = fieldData[field.key];
|
|
3135
|
+
}
|
|
3136
|
+
return result;
|
|
3137
|
+
}, {});
|
|
3112
3138
|
this.onClickFormFieldButton.emit({
|
|
3113
3139
|
config: field,
|
|
3114
|
-
data: mergeObjects(this.formData, this.popupFormData, this.taskData)
|
|
3140
|
+
data: mergeObjects(this.formData, this.popupFormData, this.taskData),
|
|
3141
|
+
extendedData: extendedFormData
|
|
3115
3142
|
});
|
|
3116
3143
|
}
|
|
3117
3144
|
// DOM Event Handlers
|