impaktapps-ui-builder 0.0.412-a → 0.0.412-d
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 +17 -14
- package/dist/impaktapps-ui-builder.es.js.map +1 -1
- package/dist/impaktapps-ui-builder.umd.js +3 -3
- package/dist/impaktapps-ui-builder.umd.js.map +1 -1
- package/dist/src/impaktapps-ui-builder/runtime/services/events.d.ts +1 -1
- package/dist/src/impaktapps-ui-builder/runtime/services/interface.d.ts +1 -0
- package/package.json +1 -1
- package/src/impaktapps-ui-builder/runtime/services/events.ts +8 -11
- package/src/impaktapps-ui-builder/runtime/services/interface.ts +1 -0
- package/src/impaktapps-ui-builder/runtime/services/service.ts +5 -8
|
@@ -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<
|
|
4
|
+
export declare function executeRefreshHandler(params: handlersProps): Promise<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
|
@@ -68,7 +68,8 @@ function executeEventsHandler(params: handlersProps) {
|
|
|
68
68
|
params.componentName,
|
|
69
69
|
params.config,
|
|
70
70
|
params.store,
|
|
71
|
-
params.service
|
|
71
|
+
params.service,
|
|
72
|
+
params.formDataHolder
|
|
72
73
|
);
|
|
73
74
|
} else if (params.config.Handler === "onBackHandler") {
|
|
74
75
|
return params.store.functionParameters?.handleBack();
|
|
@@ -102,9 +103,7 @@ export function executeRefreshHandler(params: handlersProps) {
|
|
|
102
103
|
return Promise.all(params.eventGroups.onLoad[componentName].map(compEventConfig => {
|
|
103
104
|
return executeEvents({ ...params, config: compEventConfig, componentName });
|
|
104
105
|
}));
|
|
105
|
-
}))
|
|
106
|
-
params.store.setFormdata(params.store.ctx.core.data)
|
|
107
|
-
})
|
|
106
|
+
}))
|
|
108
107
|
};
|
|
109
108
|
export function executeApiRequest(params: any) {
|
|
110
109
|
const initialBody = { ...params.userValue?.payload };
|
|
@@ -145,7 +144,7 @@ function executeCustomHandler(params: handlersProps) {
|
|
|
145
144
|
|
|
146
145
|
}
|
|
147
146
|
|
|
148
|
-
function mergeFormdata(handlerResponse: any, componentName: string, eventConfig: any, store: any, service: any) {
|
|
147
|
+
function mergeFormdata(handlerResponse: any, componentName: string, eventConfig: any, store: any, service: any,formDataHolder:any) {
|
|
149
148
|
if (eventConfig.type === "Select" && !(_.isEmpty(handlerResponse?.data) && handlerResponse?.data)) {
|
|
150
149
|
store.setSchema((pre) => {
|
|
151
150
|
return {
|
|
@@ -175,16 +174,14 @@ function mergeFormdata(handlerResponse: any, componentName: string, eventConfig:
|
|
|
175
174
|
}
|
|
176
175
|
else if (eventConfig.type === "page") {
|
|
177
176
|
if (!(_.isEmpty(handlerResponse?.data) && handlerResponse?.data)) {
|
|
178
|
-
|
|
179
|
-
|
|
177
|
+
|
|
178
|
+
store.setFormdata((pre: any) => { return { ...pre, ...handlerResponse?.data } })
|
|
180
179
|
}
|
|
181
180
|
}
|
|
182
181
|
else {
|
|
183
182
|
if (handlerResponse) {
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
handlerResponse?.data?.data : handlerResponse.data
|
|
187
|
-
// store.setFormdata((pre) => { return { ...pre, [componentName]: eventConfig.lazyLoading ? handlerResponse?.data?.data : handlerResponse.data } });
|
|
183
|
+
formDataHolder[componentName] = eventConfig.lazyLoading ? handlerResponse?.data?.data : handlerResponse.data
|
|
184
|
+
store.setFormdata((pre) => { return { ...pre,...formDataHolder } });
|
|
188
185
|
}
|
|
189
186
|
}
|
|
190
187
|
}
|
|
@@ -12,7 +12,7 @@ const notifyUiSchema = {
|
|
|
12
12
|
},
|
|
13
13
|
layout: 6,
|
|
14
14
|
};
|
|
15
|
-
|
|
15
|
+
let formDataHolder = {}
|
|
16
16
|
interface funcParamsProps {
|
|
17
17
|
store: any,
|
|
18
18
|
dynamicData: any,
|
|
@@ -72,7 +72,7 @@ export default (funcParams: funcParamsProps) => {
|
|
|
72
72
|
config: {}, componentName: "",
|
|
73
73
|
store: funcParams.store, dynamicData: funcParams.dynamicData, userValue: funcParams.userValue, service: funcParams.service,
|
|
74
74
|
serviceHolder: { downloadFile, download: doDownload, ...funcParams.functionsProvider }, eventGroups,
|
|
75
|
-
functionsProvider: funcParams.functionsProvider,
|
|
75
|
+
functionsProvider: funcParams.functionsProvider,formDataHolder
|
|
76
76
|
};
|
|
77
77
|
return {
|
|
78
78
|
setPage: async function () {
|
|
@@ -184,9 +184,7 @@ export default (funcParams: funcParamsProps) => {
|
|
|
184
184
|
})
|
|
185
185
|
}
|
|
186
186
|
}
|
|
187
|
-
}))
|
|
188
|
-
funcParams.store.setFormdata(funcParams.store.ctx.core.data)
|
|
189
|
-
})
|
|
187
|
+
}))
|
|
190
188
|
}
|
|
191
189
|
},
|
|
192
190
|
updateConfigApiBody: async function (paramValue, apiBody) {
|
|
@@ -232,6 +230,7 @@ export default (funcParams: funcParamsProps) => {
|
|
|
232
230
|
}
|
|
233
231
|
},
|
|
234
232
|
callHandler: async function (eventType: string, functionParameters?: any) {
|
|
233
|
+
formDataHolder = {}
|
|
235
234
|
const path = funcParams.dynamicData?.tableButtonPath || funcParams.dynamicData.path.split(".")[0];
|
|
236
235
|
if (eventGroups?.[eventType]?.[path] !== undefined) {
|
|
237
236
|
Promise.all(eventGroups?.[eventType]?.[path].map((eventConfig) => {
|
|
@@ -241,9 +240,7 @@ export default (funcParams: funcParamsProps) => {
|
|
|
241
240
|
config: eventConfig,
|
|
242
241
|
componentName: path
|
|
243
242
|
})
|
|
244
|
-
}))
|
|
245
|
-
funcParams.store.setFormdata(funcParams.store.ctx.core.data)
|
|
246
|
-
})
|
|
243
|
+
}))
|
|
247
244
|
|
|
248
245
|
}
|
|
249
246
|
},
|