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
|
@@ -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: () => void;
|
|
27
|
+
onChange: (updatedData: any) => 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,38 +205,44 @@ export default (funcParams: funcParamsProps) => {
|
|
|
205
205
|
return response?.data;
|
|
206
206
|
}
|
|
207
207
|
},
|
|
208
|
-
|
|
208
|
+
onChange: function (updatedData) {
|
|
209
209
|
if (!eventGroups.onChange) return;
|
|
210
|
-
|
|
211
210
|
const ChangeEventsKeysArray = Object.keys(eventGroups.onChange);
|
|
212
|
-
|
|
213
211
|
const promises = ChangeEventsKeysArray.flatMap((componentName: string) => {
|
|
214
212
|
if (
|
|
215
|
-
funcParams.store?.formData[componentName]
|
|
216
|
-
funcParams.store?.newData[componentName] === undefined
|
|
213
|
+
funcParams.store?.formData[componentName] !== funcParams.store.newData[componentName]
|
|
217
214
|
) {
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
215
|
+
if (funcParams.store.newData[componentName] === undefined) {
|
|
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
|
+
}
|
|
228
240
|
})
|
|
229
|
-
)
|
|
230
|
-
if (!isEmpty(formDataHolder)) {
|
|
231
|
-
funcParams.store.setFormdata(pre => ({
|
|
232
|
-
...pre,
|
|
233
|
-
...formDataHolder
|
|
234
|
-
}));
|
|
235
|
-
}
|
|
236
|
-
})
|
|
237
|
-
);
|
|
238
|
-
});
|
|
241
|
+
);
|
|
239
242
|
|
|
243
|
+
}
|
|
244
|
+
return [];
|
|
245
|
+
});
|
|
240
246
|
Promise.allSettled(promises);
|
|
241
247
|
},
|
|
242
248
|
callExecuteEvents: async function (paramValue, apiBody, eventType: string) {
|