impaktapps-ui-builder 1.0.124 → 1.0.126
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 +42 -27
- package/dist/impaktapps-ui-builder.es.js.map +1 -1
- package/dist/impaktapps-ui-builder.umd.js +1 -1
- 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 +52 -29
|
@@ -22,7 +22,7 @@ declare const _default: (funcParams: funcParamsProps) => {
|
|
|
22
22
|
onRowMovement: (paginationValues: any) => Promise<any>;
|
|
23
23
|
onPaginationChange: (paginationValues: any) => Promise<any>;
|
|
24
24
|
getSelectOptions: (param: any) => Promise<any>;
|
|
25
|
-
onChange: () =>
|
|
25
|
+
onChange: () => void;
|
|
26
26
|
callExecuteEvents: (paramValue: any, apiBody: any, eventType: string) => Promise<any>;
|
|
27
27
|
onBack: (functionParameters: any) => Promise<void>;
|
|
28
28
|
onNext: (functionParameters: any) => Promise<void>;
|
package/package.json
CHANGED
|
@@ -183,28 +183,39 @@ export default (funcParams: funcParamsProps) => {
|
|
|
183
183
|
return response?.data;
|
|
184
184
|
}
|
|
185
185
|
},
|
|
186
|
-
onChange:
|
|
187
|
-
if (eventGroups.onChange)
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
186
|
+
onChange: function () {
|
|
187
|
+
if (!eventGroups.onChange) return;
|
|
188
|
+
|
|
189
|
+
const ChangeEventsKeysArray = Object.keys(eventGroups.onChange);
|
|
190
|
+
|
|
191
|
+
const promises = ChangeEventsKeysArray.flatMap((componentName: string) => {
|
|
192
|
+
if (
|
|
193
|
+
funcParams.store?.formData[componentName] === funcParams.store.newData[componentName] ||
|
|
194
|
+
funcParams.store?.newData[componentName] === undefined
|
|
195
|
+
) {
|
|
196
|
+
return [];
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
return eventGroups.onChange[componentName].map(eventConfig =>
|
|
200
|
+
Promise.resolve(
|
|
201
|
+
executeEvents({
|
|
202
|
+
...executeEventsParameters,
|
|
203
|
+
config: eventConfig,
|
|
204
|
+
componentName,
|
|
205
|
+
formDataHolder
|
|
206
|
+
})
|
|
207
|
+
).then(() => {
|
|
202
208
|
if (!isEmpty(formDataHolder)) {
|
|
203
|
-
funcParams.store.setFormdata(
|
|
209
|
+
funcParams.store.setFormdata(pre => ({
|
|
210
|
+
...pre,
|
|
211
|
+
...formDataHolder
|
|
212
|
+
}));
|
|
204
213
|
}
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
}
|
|
214
|
+
})
|
|
215
|
+
);
|
|
216
|
+
});
|
|
217
|
+
|
|
218
|
+
Promise.allSettled(promises);
|
|
208
219
|
},
|
|
209
220
|
callExecuteEvents: async function (paramValue, apiBody, eventType: string) {
|
|
210
221
|
let LastCallResponse = undefined;
|
|
@@ -250,21 +261,33 @@ export default (funcParams: funcParamsProps) => {
|
|
|
250
261
|
}
|
|
251
262
|
},
|
|
252
263
|
callHandler: function (eventType: string, functionParameters?: any) {
|
|
253
|
-
const path =
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
264
|
+
const path =
|
|
265
|
+
funcParams.dynamicData?.tableButtonPath ||
|
|
266
|
+
funcParams.dynamicData.path.split(".").pop();
|
|
267
|
+
|
|
268
|
+
if (!eventGroups?.[eventType]?.[path]) return;
|
|
269
|
+
|
|
270
|
+
const promises = eventGroups[eventType][path].map(eventConfig => {
|
|
271
|
+
executeEventsParameters.store.functionParameters = functionParameters;
|
|
272
|
+
|
|
273
|
+
return Promise.resolve(
|
|
274
|
+
executeEvents({
|
|
258
275
|
...executeEventsParameters,
|
|
259
276
|
config: eventConfig,
|
|
260
277
|
componentName: path,
|
|
261
|
-
formDataHolder
|
|
278
|
+
formDataHolder
|
|
262
279
|
})
|
|
280
|
+
).then(() => {
|
|
263
281
|
if (!isEmpty(formDataHolder)) {
|
|
264
|
-
funcParams.store.setFormdata(
|
|
282
|
+
funcParams.store.setFormdata(pre => ({
|
|
283
|
+
...pre,
|
|
284
|
+
...formDataHolder
|
|
285
|
+
}));
|
|
265
286
|
}
|
|
266
|
-
})
|
|
267
|
-
}
|
|
287
|
+
});
|
|
288
|
+
});
|
|
289
|
+
|
|
290
|
+
Promise.allSettled(promises);
|
|
268
291
|
},
|
|
269
292
|
downloadFile: downloadFile,
|
|
270
293
|
downloadFileFromUrl: downloadFileFromUrl,
|