impaktapps-ui-builder 1.0.421 → 1.0.422
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/impaktapps-ui-builder.es.js +33 -21
- package/dist/impaktapps-ui-builder.es.js.map +1 -1
- package/dist/impaktapps-ui-builder.umd.js +4 -4
- package/dist/impaktapps-ui-builder.umd.js.map +1 -1
- package/dist/src/impaktapps-ui-builder/runtime/services/service.d.ts +1 -1
- package/package.json +1 -1
- package/src/impaktapps-ui-builder/runtime/services/service.ts +31 -25
|
@@ -10946,32 +10946,44 @@ var service = (funcParams) => {
|
|
|
10946
10946
|
return response == null ? void 0 : response.data;
|
|
10947
10947
|
}
|
|
10948
10948
|
},
|
|
10949
|
-
onChange: function() {
|
|
10949
|
+
onChange: function(updatedData) {
|
|
10950
10950
|
if (!eventGroups.onChange)
|
|
10951
10951
|
return;
|
|
10952
10952
|
const ChangeEventsKeysArray = Object.keys(eventGroups.onChange);
|
|
10953
10953
|
const promises = ChangeEventsKeysArray.flatMap((componentName) => {
|
|
10954
|
-
var _a
|
|
10955
|
-
if (((_a = funcParams.store) == null ? void 0 : _a.formData[componentName])
|
|
10956
|
-
|
|
10957
|
-
|
|
10958
|
-
|
|
10959
|
-
|
|
10960
|
-
|
|
10961
|
-
|
|
10962
|
-
|
|
10963
|
-
|
|
10964
|
-
|
|
10965
|
-
|
|
10966
|
-
).then(() => {
|
|
10967
|
-
if (!lodash.exports.isEmpty(formDataHolder)) {
|
|
10968
|
-
funcParams.store.setFormdata((pre) => ({
|
|
10969
|
-
...pre,
|
|
10970
|
-
...formDataHolder
|
|
10971
|
-
}));
|
|
10954
|
+
var _a;
|
|
10955
|
+
if (((_a = funcParams.store) == null ? void 0 : _a.formData[componentName]) !== funcParams.store.newData[componentName]) {
|
|
10956
|
+
if (funcParams.store.newData[componentName] === void 0) {
|
|
10957
|
+
const allKeys = _.union(
|
|
10958
|
+
Object.keys(funcParams.store.formData),
|
|
10959
|
+
Object.keys(updatedData)
|
|
10960
|
+
);
|
|
10961
|
+
const changedKeys = allKeys.filter(
|
|
10962
|
+
(key) => !_.isEqual(funcParams.store.formData[key], updatedData[key])
|
|
10963
|
+
);
|
|
10964
|
+
if (!changedKeys[0]) {
|
|
10965
|
+
return [];
|
|
10972
10966
|
}
|
|
10973
|
-
}
|
|
10974
|
-
|
|
10967
|
+
}
|
|
10968
|
+
return eventGroups.onChange[componentName].map(
|
|
10969
|
+
(eventConfig) => Promise.resolve(
|
|
10970
|
+
executeEvents({
|
|
10971
|
+
...executeEventsParameters,
|
|
10972
|
+
config: eventConfig,
|
|
10973
|
+
componentName,
|
|
10974
|
+
formDataHolder
|
|
10975
|
+
})
|
|
10976
|
+
).then(() => {
|
|
10977
|
+
if (!lodash.exports.isEmpty(formDataHolder)) {
|
|
10978
|
+
funcParams.store.setFormdata((pre) => ({
|
|
10979
|
+
...pre,
|
|
10980
|
+
...formDataHolder
|
|
10981
|
+
}));
|
|
10982
|
+
}
|
|
10983
|
+
})
|
|
10984
|
+
);
|
|
10985
|
+
}
|
|
10986
|
+
return [];
|
|
10975
10987
|
});
|
|
10976
10988
|
Promise.allSettled(promises);
|
|
10977
10989
|
},
|