impaktapps-ui-builder 0.0.411 → 0.0.412-b

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.
@@ -8545,7 +8545,10 @@ function executeRefreshHandler(params2) {
8545
8545
  return Promise.all(params2.eventGroups.onLoad[componentName].map((compEventConfig) => {
8546
8546
  return executeEvents({ ...params2, config: compEventConfig, componentName });
8547
8547
  }));
8548
- }));
8548
+ })).then(() => {
8549
+ const updatedData = _.cloneDeep(params2.store.ctx.core.data);
8550
+ params2.store.setFormdata(updatedData);
8551
+ });
8549
8552
  }
8550
8553
  function executeApiRequest(params2) {
8551
8554
  var _a;
@@ -8583,15 +8586,16 @@ function executeCustomHandler(params) {
8583
8586
  }
8584
8587
  }
8585
8588
  function mergeFormdata(handlerResponse, componentName, eventConfig, store2, service2) {
8589
+ var _a;
8586
8590
  if (eventConfig.type === "Select" && !(_.isEmpty(handlerResponse == null ? void 0 : handlerResponse.data) && (handlerResponse == null ? void 0 : handlerResponse.data))) {
8587
8591
  store2.setSchema((pre) => {
8588
- var _a;
8592
+ var _a2;
8589
8593
  return {
8590
8594
  ...pre,
8591
8595
  properties: {
8592
8596
  ...pre.properties,
8593
8597
  [componentName]: {
8594
- ...(_a = pre.properties) == null ? void 0 : _a[componentName],
8598
+ ...(_a2 = pre.properties) == null ? void 0 : _a2[componentName],
8595
8599
  oneOf: handlerResponse.data
8596
8600
  }
8597
8601
  }
@@ -8599,13 +8603,13 @@ function mergeFormdata(handlerResponse, componentName, eventConfig, store2, serv
8599
8603
  });
8600
8604
  } else if (eventConfig.type === "MultipleSelect" && !(_.isEmpty(handlerResponse == null ? void 0 : handlerResponse.data) && (handlerResponse == null ? void 0 : handlerResponse.data))) {
8601
8605
  store2.setSchema((pre) => {
8602
- var _a;
8606
+ var _a2;
8603
8607
  return {
8604
8608
  ...pre,
8605
8609
  properties: {
8606
8610
  ...pre.properties,
8607
8611
  [componentName]: {
8608
- ...(_a = pre.properties) == null ? void 0 : _a[componentName],
8612
+ ...(_a2 = pre.properties) == null ? void 0 : _a2[componentName],
8609
8613
  type: "array",
8610
8614
  items: {
8611
8615
  oneOf: handlerResponse == null ? void 0 : handlerResponse.data
@@ -8616,16 +8620,11 @@ function mergeFormdata(handlerResponse, componentName, eventConfig, store2, serv
8616
8620
  });
8617
8621
  } else if (eventConfig.type === "page") {
8618
8622
  if (!(_.isEmpty(handlerResponse == null ? void 0 : handlerResponse.data) && (handlerResponse == null ? void 0 : handlerResponse.data))) {
8619
- store2.setFormdata((pre) => {
8620
- return { ...pre, ...handlerResponse == null ? void 0 : handlerResponse.data };
8621
- });
8623
+ store2.ctx.core.data = { ...store2.ctx.core.data, ...handlerResponse.data };
8622
8624
  }
8623
8625
  } else {
8624
8626
  if (handlerResponse) {
8625
- store2.setFormdata((pre) => {
8626
- var _a;
8627
- return { ...pre, [componentName]: eventConfig.lazyLoading ? (_a = handlerResponse == null ? void 0 : handlerResponse.data) == null ? void 0 : _a.data : handlerResponse.data };
8628
- });
8627
+ store2.ctx.core.data[componentName] = eventConfig.lazyLoading ? (_a = handlerResponse == null ? void 0 : handlerResponse.data) == null ? void 0 : _a.data : handlerResponse.data;
8629
8628
  }
8630
8629
  }
8631
8630
  }
@@ -8884,7 +8883,10 @@ var service = (funcParams) => {
8884
8883
  });
8885
8884
  }
8886
8885
  }
8887
- }));
8886
+ })).then((res) => {
8887
+ const updatedData = _.cloneDeep(funcParams.store.ctx.core.data);
8888
+ funcParams.store.setFormdata(updatedData);
8889
+ });
8888
8890
  }
8889
8891
  },
8890
8892
  updateConfigApiBody: async function(paramValue, apiBody) {
@@ -8939,14 +8941,17 @@ var service = (funcParams) => {
8939
8941
  var _a, _b, _c;
8940
8942
  const path = ((_a = funcParams.dynamicData) == null ? void 0 : _a.tableButtonPath) || funcParams.dynamicData.path.split(".")[0];
8941
8943
  if (((_b = eventGroups == null ? void 0 : eventGroups[eventType]) == null ? void 0 : _b[path]) !== void 0) {
8942
- for (const eventConfig of (_c = eventGroups == null ? void 0 : eventGroups[eventType]) == null ? void 0 : _c[path]) {
8944
+ Promise.all((_c = eventGroups == null ? void 0 : eventGroups[eventType]) == null ? void 0 : _c[path].map((eventConfig) => {
8943
8945
  executeEventsParameters.store.functionParameters = functionParameters;
8944
8946
  executeEvents({
8945
8947
  ...executeEventsParameters,
8946
8948
  config: eventConfig,
8947
8949
  componentName: path
8948
8950
  });
8949
- }
8951
+ })).then((res) => {
8952
+ const updatedData = _.cloneDeep(funcParams.store.ctx.core.data);
8953
+ funcParams.store.setFormdata(updatedData);
8954
+ });
8950
8955
  }
8951
8956
  },
8952
8957
  downloadFile: downloadFile$1,