impaktapps-ui-builder 1.0.422 → 1.0.423
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 +20 -32
- 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 +24 -31
|
@@ -24,7 +24,7 @@ declare const _default: (funcParams: funcParamsProps) => {
|
|
|
24
24
|
onRowMovement: (paginationValues: any) => Promise<any>;
|
|
25
25
|
onPaginationChange: (paginationValues: any) => Promise<any>;
|
|
26
26
|
getSelectOptions: (param: any) => Promise<any>;
|
|
27
|
-
onChange: (
|
|
27
|
+
onChange: () => void;
|
|
28
28
|
callExecuteEvents: (paramValue: any, apiBody: any, eventType: string) => Promise<any>;
|
|
29
29
|
onBack: (functionParameters: any) => Promise<void>;
|
|
30
30
|
onNext: (functionParameters: any) => Promise<void>;
|
package/package.json
CHANGED
|
@@ -205,44 +205,37 @@ export default (funcParams: funcParamsProps) => {
|
|
|
205
205
|
return response?.data;
|
|
206
206
|
}
|
|
207
207
|
},
|
|
208
|
-
|
|
208
|
+
onChange: function () {
|
|
209
209
|
if (!eventGroups.onChange) return;
|
|
210
|
+
|
|
210
211
|
const ChangeEventsKeysArray = Object.keys(eventGroups.onChange);
|
|
212
|
+
|
|
211
213
|
const promises = ChangeEventsKeysArray.flatMap((componentName: string) => {
|
|
212
214
|
if (
|
|
213
|
-
funcParams.store?.formData[componentName]
|
|
215
|
+
funcParams.store?.formData[componentName] === funcParams.store.newData[componentName]
|
|
214
216
|
) {
|
|
215
|
-
|
|
216
|
-
const allKeys = _.union(
|
|
217
|
-
Object.keys(funcParams.store.formData),
|
|
218
|
-
Object.keys(updatedData),
|
|
219
|
-
);
|
|
220
|
-
const changedKeys = allKeys.filter(
|
|
221
|
-
(key) => !_.isEqual(funcParams.store.formData[key], updatedData[key]),
|
|
222
|
-
);
|
|
223
|
-
if (!changedKeys[0]) { return [] }
|
|
224
|
-
}
|
|
225
|
-
return eventGroups.onChange[componentName].map(eventConfig =>
|
|
226
|
-
Promise.resolve(
|
|
227
|
-
executeEvents({
|
|
228
|
-
...executeEventsParameters,
|
|
229
|
-
config: eventConfig,
|
|
230
|
-
componentName,
|
|
231
|
-
formDataHolder
|
|
232
|
-
})
|
|
233
|
-
).then(() => {
|
|
234
|
-
if (!isEmpty(formDataHolder)) {
|
|
235
|
-
funcParams.store.setFormdata(pre => ({
|
|
236
|
-
...pre,
|
|
237
|
-
...formDataHolder
|
|
238
|
-
}));
|
|
239
|
-
}
|
|
240
|
-
})
|
|
241
|
-
);
|
|
242
|
-
|
|
217
|
+
return [];
|
|
243
218
|
}
|
|
244
|
-
|
|
219
|
+
|
|
220
|
+
return eventGroups.onChange[componentName].map(eventConfig =>
|
|
221
|
+
Promise.resolve(
|
|
222
|
+
executeEvents({
|
|
223
|
+
...executeEventsParameters,
|
|
224
|
+
config: eventConfig,
|
|
225
|
+
componentName,
|
|
226
|
+
formDataHolder
|
|
227
|
+
})
|
|
228
|
+
).then(() => {
|
|
229
|
+
if (!isEmpty(formDataHolder)) {
|
|
230
|
+
funcParams.store.setFormdata(pre => ({
|
|
231
|
+
...pre,
|
|
232
|
+
...formDataHolder
|
|
233
|
+
}));
|
|
234
|
+
}
|
|
235
|
+
})
|
|
236
|
+
);
|
|
245
237
|
});
|
|
238
|
+
|
|
246
239
|
Promise.allSettled(promises);
|
|
247
240
|
},
|
|
248
241
|
callExecuteEvents: async function (paramValue, apiBody, eventType: string) {
|