impaktapps-ui-builder 0.0.412-b → 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 -17
- 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 -12
- package/src/impaktapps-ui-builder/runtime/services/interface.ts +1 -0
- package/src/impaktapps-ui-builder/runtime/services/service.ts +5 -10
|
@@ -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,10 +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
|
-
const updatedData = _.cloneDeep(params.store.ctx.core.data)
|
|
107
|
-
params.store.setFormdata(updatedData)
|
|
108
|
-
})
|
|
106
|
+
}))
|
|
109
107
|
};
|
|
110
108
|
export function executeApiRequest(params: any) {
|
|
111
109
|
const initialBody = { ...params.userValue?.payload };
|
|
@@ -146,7 +144,7 @@ function executeCustomHandler(params: handlersProps) {
|
|
|
146
144
|
|
|
147
145
|
}
|
|
148
146
|
|
|
149
|
-
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) {
|
|
150
148
|
if (eventConfig.type === "Select" && !(_.isEmpty(handlerResponse?.data) && handlerResponse?.data)) {
|
|
151
149
|
store.setSchema((pre) => {
|
|
152
150
|
return {
|
|
@@ -176,16 +174,14 @@ function mergeFormdata(handlerResponse: any, componentName: string, eventConfig:
|
|
|
176
174
|
}
|
|
177
175
|
else if (eventConfig.type === "page") {
|
|
178
176
|
if (!(_.isEmpty(handlerResponse?.data) && handlerResponse?.data)) {
|
|
179
|
-
|
|
180
|
-
|
|
177
|
+
|
|
178
|
+
store.setFormdata((pre: any) => { return { ...pre, ...handlerResponse?.data } })
|
|
181
179
|
}
|
|
182
180
|
}
|
|
183
181
|
else {
|
|
184
182
|
if (handlerResponse) {
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
handlerResponse?.data?.data : handlerResponse.data
|
|
188
|
-
// 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 } });
|
|
189
185
|
}
|
|
190
186
|
}
|
|
191
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,10 +184,7 @@ export default (funcParams: funcParamsProps) => {
|
|
|
184
184
|
})
|
|
185
185
|
}
|
|
186
186
|
}
|
|
187
|
-
}))
|
|
188
|
-
const updatedData = _.cloneDeep(funcParams.store.ctx.core.data)
|
|
189
|
-
funcParams.store.setFormdata(updatedData)
|
|
190
|
-
})
|
|
187
|
+
}))
|
|
191
188
|
}
|
|
192
189
|
},
|
|
193
190
|
updateConfigApiBody: async function (paramValue, apiBody) {
|
|
@@ -233,6 +230,7 @@ export default (funcParams: funcParamsProps) => {
|
|
|
233
230
|
}
|
|
234
231
|
},
|
|
235
232
|
callHandler: async function (eventType: string, functionParameters?: any) {
|
|
233
|
+
formDataHolder = {}
|
|
236
234
|
const path = funcParams.dynamicData?.tableButtonPath || funcParams.dynamicData.path.split(".")[0];
|
|
237
235
|
if (eventGroups?.[eventType]?.[path] !== undefined) {
|
|
238
236
|
Promise.all(eventGroups?.[eventType]?.[path].map((eventConfig) => {
|
|
@@ -242,10 +240,7 @@ export default (funcParams: funcParamsProps) => {
|
|
|
242
240
|
config: eventConfig,
|
|
243
241
|
componentName: path
|
|
244
242
|
})
|
|
245
|
-
}))
|
|
246
|
-
const updatedData = _.cloneDeep(funcParams.store.ctx.core.data)
|
|
247
|
-
funcParams.store.setFormdata(updatedData)
|
|
248
|
-
})
|
|
243
|
+
}))
|
|
249
244
|
|
|
250
245
|
}
|
|
251
246
|
},
|