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.
- package/dist/impaktapps-ui-builder.es.js +11 -4
- package/dist/impaktapps-ui-builder.es.js.map +1 -1
- package/dist/impaktapps-ui-builder.umd.js +6 -6
- package/dist/impaktapps-ui-builder.umd.js.map +1 -1
- package/dist/src/impaktapps-ui-builder/runtime/services/events.d.ts +1 -4
- package/package.json +1 -1
- package/src/impaktapps-ui-builder/runtime/services/events.ts +9 -3
- package/src/impaktapps-ui-builder/runtime/services/service.ts +5 -1
|
@@ -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
|
@@ -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 {
|
|
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,
|