impaktapps-ui-builder 0.0.412-g → 0.0.412-h
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 +7 -3
- 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/events.d.ts +1 -1
- package/package.json +1 -1
- package/src/impaktapps-ui-builder/runtime/services/events.ts +23 -6
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { handlersProps } from "./interface";
|
|
2
2
|
export declare const executeEvents: (params: handlersProps) => any;
|
|
3
3
|
export declare function getRefreshElements(eventConfig: any, eventGropus: any): string[];
|
|
4
|
-
export declare function executeRefreshHandler(params: handlersProps): Promise<any[][]>;
|
|
4
|
+
export declare function executeRefreshHandler(params: handlersProps): Promise<PromiseSettledResult<void | PromiseSettledResult<any>[]>[]>;
|
|
5
5
|
export declare function executeApiRequest(params: any): any;
|
|
6
6
|
export declare function shouldEventExecute(params: handlersProps): any;
|
|
7
7
|
export declare function buildApiPayload(compConfig: any, body: any, headers: any, store: any, dynamicData: any, userValue: any, service: any): {
|
package/package.json
CHANGED
|
@@ -96,15 +96,32 @@ export function getRefreshElements(eventConfig: any, eventGropus: any) {
|
|
|
96
96
|
console.log(result);
|
|
97
97
|
return result;
|
|
98
98
|
}
|
|
99
|
-
export function executeRefreshHandler(params: handlersProps) {
|
|
99
|
+
export async function executeRefreshHandler(params: handlersProps) {
|
|
100
100
|
const compToRefresh: string[] = getRefreshElements(params.config, params.eventGroups);
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
101
|
+
|
|
102
|
+
// Create an array of promises for the components to refresh
|
|
103
|
+
return Promise.allSettled(compToRefresh.map(componentName => {
|
|
104
|
+
const eventConfigs = params.eventGroups.onLoad[componentName];
|
|
105
|
+
|
|
106
|
+
// If eventConfigs is undefined, return a resolved promise
|
|
107
|
+
if (!eventConfigs) {
|
|
108
|
+
return Promise.resolve(); // Resolve immediately if there are no events to load
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
// Create an array of promises for the defined eventConfigs
|
|
112
|
+
return Promise.allSettled(eventConfigs.map(compEventConfig => {
|
|
104
113
|
return executeEvents({ ...params, config: compEventConfig, componentName });
|
|
105
114
|
}));
|
|
106
|
-
}))
|
|
107
|
-
}
|
|
115
|
+
}));
|
|
116
|
+
}
|
|
117
|
+
// export function executeRefreshHandler(params: handlersProps) {
|
|
118
|
+
// const compToRefresh: string[] = getRefreshElements(params.config, params.eventGroups);
|
|
119
|
+
// return Promise.all(compToRefresh.map(componentName => {
|
|
120
|
+
// return Promise.all(params.eventGroups.onLoad[componentName].map(compEventConfig => {
|
|
121
|
+
// return executeEvents({ ...params, config: compEventConfig, componentName });
|
|
122
|
+
// }));
|
|
123
|
+
// }))
|
|
124
|
+
// };
|
|
108
125
|
export function executeApiRequest(params: any) {
|
|
109
126
|
const initialBody = { ...params.userValue?.payload };
|
|
110
127
|
const initialHeaders = {
|