impaktapps-ui-builder 0.0.412-f → 0.0.412-g
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 +5 -0
- 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/package.json +1 -1
- package/src/impaktapps-ui-builder/runtime/services/events.ts +7 -8
- package/src/impaktapps-ui-builder/runtime/services/service.ts +3 -7
package/package.json
CHANGED
|
@@ -144,7 +144,7 @@ function executeCustomHandler(params: handlersProps) {
|
|
|
144
144
|
|
|
145
145
|
}
|
|
146
146
|
|
|
147
|
-
function mergeFormdata(handlerResponse: any, componentName: string, eventConfig: any, store: any, service: any,formDataHolder:any) {
|
|
147
|
+
function mergeFormdata(handlerResponse: any, componentName: string, eventConfig: any, store: any, service: any, formDataHolder: any) {
|
|
148
148
|
if (eventConfig.type === "Select" && !(_.isEmpty(handlerResponse?.data) && handlerResponse?.data)) {
|
|
149
149
|
store.setSchema((pre) => {
|
|
150
150
|
return {
|
|
@@ -174,14 +174,17 @@ function mergeFormdata(handlerResponse: any, componentName: string, eventConfig:
|
|
|
174
174
|
}
|
|
175
175
|
else if (eventConfig.type === "page") {
|
|
176
176
|
if (!(_.isEmpty(handlerResponse?.data) && handlerResponse?.data)) {
|
|
177
|
-
|
|
178
|
-
|
|
177
|
+
store.newData = {
|
|
178
|
+
...store.newData,
|
|
179
|
+
...handlerResponse?.data
|
|
180
|
+
}
|
|
181
|
+
store.setFormdata((pre: any) => { return { ...pre, ...handlerResponse?.data } })
|
|
179
182
|
}
|
|
180
183
|
}
|
|
181
184
|
else {
|
|
182
185
|
if (handlerResponse) {
|
|
183
186
|
formDataHolder[componentName] = eventConfig.lazyLoading ? handlerResponse?.data?.data : handlerResponse.data
|
|
184
|
-
|
|
187
|
+
store.setFormdata((pre) => { return { ...pre, ...formDataHolder } });
|
|
185
188
|
}
|
|
186
189
|
}
|
|
187
190
|
}
|
|
@@ -248,14 +251,10 @@ export function buildApiPayload(compConfig: any, body: any, headers: any, store:
|
|
|
248
251
|
if (compConfig?.headers) {
|
|
249
252
|
headers = buildHeadersFormat(compConfig.headers);
|
|
250
253
|
}
|
|
251
|
-
|
|
252
254
|
if (compConfig.body) {
|
|
253
255
|
body = { ...buildBodyFormat(compConfig.body, store.newData || store?.ctx?.core?.data || store.formData, userValue) };
|
|
254
256
|
}
|
|
255
|
-
|
|
256
257
|
const promiseChain = { body, headers };
|
|
257
|
-
|
|
258
|
-
|
|
259
258
|
if (compConfig.apiBody) {
|
|
260
259
|
const makeFunc = eval(compConfig.apiBody);
|
|
261
260
|
return { body: makeFunc(store, dynamicData, userValue, promiseChain.body), headers: promiseChain.headers };
|
|
@@ -54,7 +54,6 @@ export const extractEvents = (eventConfig: any) => {
|
|
|
54
54
|
});
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
|
-
|
|
58
57
|
extractsConfigEvents(eventConfig)
|
|
59
58
|
if (eventConfig?.elements) {
|
|
60
59
|
eventConfig.elements.forEach(extractEvents);
|
|
@@ -72,12 +71,12 @@ export default (funcParams: funcParamsProps) => {
|
|
|
72
71
|
config: {}, componentName: "",
|
|
73
72
|
store: funcParams.store, dynamicData: funcParams.dynamicData, userValue: funcParams.userValue, service: funcParams.service,
|
|
74
73
|
serviceHolder: { downloadFile, download: doDownload, ...funcParams.functionsProvider }, eventGroups,
|
|
75
|
-
functionsProvider: funcParams.functionsProvider,formDataHolder
|
|
74
|
+
functionsProvider: funcParams.functionsProvider, formDataHolder
|
|
76
75
|
};
|
|
77
76
|
return {
|
|
78
77
|
setPage: async function () {
|
|
79
|
-
funcParams.store.setFormdata({})
|
|
80
|
-
|
|
78
|
+
funcParams.store.setFormdata({});
|
|
79
|
+
funcParams.store.newData = {};
|
|
81
80
|
const pageBasicDetailString = localStorage.getItem("pagemasterMetaData")
|
|
82
81
|
if (pageBasicDetailString) {
|
|
83
82
|
pageData = JSON.parse(pageBasicDetailString)
|
|
@@ -114,7 +113,6 @@ export default (funcParams: funcParamsProps) => {
|
|
|
114
113
|
)
|
|
115
114
|
uiSchema.elements.push(notifyUiSchema);
|
|
116
115
|
funcParams.store.setUiSchema(uiSchema);
|
|
117
|
-
|
|
118
116
|
},
|
|
119
117
|
onCellRenderer: (cellParams) => {
|
|
120
118
|
if (eventGroups.onCellRenderer) {
|
|
@@ -241,10 +239,8 @@ export default (funcParams: funcParamsProps) => {
|
|
|
241
239
|
componentName: path
|
|
242
240
|
})
|
|
243
241
|
}))
|
|
244
|
-
|
|
245
242
|
}
|
|
246
243
|
},
|
|
247
|
-
|
|
248
244
|
downloadFile: downloadFile,
|
|
249
245
|
download: doDownload,
|
|
250
246
|
...funcParams.functionsProvider
|