impaktapps-ui-builder 0.0.282 → 0.0.283

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.
@@ -1,7 +1,4 @@
1
- export declare const executeEvents: (config: any, componentName: string, store: any, dynamicData: any, userValue: any, service: any, serviceHolder: any, eventGroups?: any, parentEventOutput?: any) => Promise<{
2
- response: any;
3
- events: any;
4
- }>;
1
+ export declare const executeEvents: (config: any, componentName: string, store: any, dynamicData: any, userValue: any, service: any, serviceHolder: any, eventGroups?: any, parentEventOutput?: any) => Promise<any>;
5
2
  export declare function buildApiPayload(compConfig: any, body: any, headers: any, store: any, dynamicData: any, userValue: any, service: any): Promise<{
6
3
  body: any;
7
4
  headers: any;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "impaktapps-ui-builder",
3
- "version": "0.0.282",
3
+ "version": "0.0.283",
4
4
  "scripts": {
5
5
  "dev": "vite",
6
6
  "build": "tsc && vite build",
@@ -12,6 +12,9 @@ export const executeEvents = async (
12
12
  const { response, events } = await executetOnLoadEvent(config, componentName,
13
13
  store, dynamicData, userValue,
14
14
  service, serviceHolder, eventGroups, parentEventOutput)
15
+ if (config.returnResponse) {
16
+ return response;
17
+ }
15
18
  LoadResponse = response;
16
19
  nextEvent = events;
17
20
  }
@@ -48,6 +51,9 @@ const executetOnLoadEvent = async (
48
51
  const { response } = await executeEventsHandler(config, componentName,
49
52
  store, dynamicData, userValue,
50
53
  service, serviceHolder, eventGroups, parentEventOutput)
54
+ if(config.returnResponse){
55
+ return {response}
56
+ }
51
57
  const SuccessEvent = config?.events.filter(e => e.eventType === "Success")
52
58
  const setEvent = SuccessEvent.length > 0 ? SuccessEvent : [{ Handler: "mergeFormdata", eventType: "Success", type: config.type }]
53
59
  return { response, events: setEvent };
@@ -124,6 +130,9 @@ async function executeApiEventHandler(apiHandlerConfig: any, componentName: stri
124
130
  body,
125
131
  headers && { headers: headers }
126
132
  );
133
+ if(apiHandlerConfig.returnResponse){
134
+ return {response}
135
+ }
127
136
  return { response, events: apiHandlerConfig?.events };;
128
137
  }
129
138
 
@@ -162,9 +171,6 @@ async function mergeFormdata(handlerResponse: any, componentName: string, eventC
162
171
  }
163
172
  })
164
173
  }
165
- else if (eventConfig.type === "LazyLoadingTable") {
166
- store.setFormdata((pre) => { return { ...pre, [`${componentName}Backend`]: handlerResponse } });
167
- }
168
174
  else if (eventConfig.type === "page") {
169
175
  store.setFormdata((pre: any) => { return { ...pre, ...handlerResponse?.data } })
170
176
  }
@@ -85,11 +85,15 @@ export default (funcParams: funcParamsProps) => {
85
85
  {key:"globalFilter",value: paginationValues.globalFilter ?? ''}
86
86
  ]
87
87
  if (eventConfig.body) {
88
+ eventConfig.returnResponse = true
88
89
  eventConfig.body = [
89
90
  ...eventConfig.body,
90
91
  ...bodyValues
91
92
  ]
92
- } else { eventConfig.body = bodyValues; };
93
+ } else {
94
+ eventConfig.returnResponse = true
95
+ eventConfig.body = bodyValues;
96
+ };
93
97
  await executeEvents(
94
98
  eventConfig, paginationValues.path,
95
99
  funcParams.store, funcParams.dynamicData, funcParams.userValue, funcParams.service,