impaktapps-ui-builder 1.0.58 → 1.0.59-flcikering.0.2
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 +30 -16
- package/dist/impaktapps-ui-builder.es.js.map +1 -1
- package/dist/impaktapps-ui-builder.umd.js +9 -9
- package/dist/impaktapps-ui-builder.umd.js.map +1 -1
- package/dist/src/impaktapps-ui-builder/runtime/services/service.d.ts +1 -1
- package/package.json +1 -1
- package/src/impaktapps-ui-builder/runtime/services/events.ts +52 -9
- package/src/impaktapps-ui-builder/runtime/services/service.ts +1 -1
|
@@ -12,7 +12,7 @@ declare const _default: (funcParams: funcParamsProps) => {
|
|
|
12
12
|
onCellRenderer: (cellParams: any) => {};
|
|
13
13
|
onClick: () => void;
|
|
14
14
|
onKeyDown: () => void;
|
|
15
|
-
onFileDelete: () => void
|
|
15
|
+
onFileDelete: () => Promise<void>;
|
|
16
16
|
onMount: () => void;
|
|
17
17
|
onFileDownload: () => void;
|
|
18
18
|
onFileUpload: () => void;
|
package/package.json
CHANGED
|
@@ -179,24 +179,63 @@ function mergeFormdata(handlerResponse: any, componentName: string, eventConfig:
|
|
|
179
179
|
}
|
|
180
180
|
else if (eventConfig.type === "page") {
|
|
181
181
|
if (!(_.isEmpty(handlerResponse?.data) && handlerResponse?.data)) {
|
|
182
|
+
// store.newData = {
|
|
183
|
+
// ...store.newData,
|
|
184
|
+
// ...handlerResponse?.data
|
|
185
|
+
// }
|
|
186
|
+
// store.setFormdata((pre: any) => { return { ...pre, ...handlerResponse?.data } })
|
|
187
|
+
const clonedData = _.cloneDeep(handlerResponse.data);
|
|
188
|
+
|
|
189
|
+
// ✅ Update store.newData immutably
|
|
182
190
|
store.newData = {
|
|
183
191
|
...store.newData,
|
|
184
|
-
...
|
|
185
|
-
}
|
|
186
|
-
|
|
192
|
+
...clonedData,
|
|
193
|
+
};
|
|
194
|
+
|
|
195
|
+
// ✅ Update formData immutably with cloned data
|
|
196
|
+
store.setFormdata((prev: any) => ({
|
|
197
|
+
...prev,
|
|
198
|
+
...clonedData,
|
|
199
|
+
}));
|
|
187
200
|
}
|
|
188
201
|
}
|
|
189
202
|
else if (eventConfig.type === "Table" && eventConfig.lazyLoading) {
|
|
203
|
+
|
|
204
|
+
console.log("eventConfig.type === Table >>", handlerResponse );
|
|
190
205
|
if (handlerResponse && handlerResponse?.data) {
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
206
|
+
const tableData = Array.isArray(handlerResponse.data?.data)
|
|
207
|
+
? cloneDeep(handlerResponse.data.data)
|
|
208
|
+
: cloneDeep(handlerResponse.data?.data);
|
|
209
|
+
|
|
210
|
+
const rowCount = handlerResponse.data?.meta?.totalRowCount ?? null;
|
|
211
|
+
|
|
212
|
+
const newFormDataHolder = {
|
|
213
|
+
...formDataHolder,
|
|
214
|
+
[componentName]: tableData,
|
|
215
|
+
[`${componentName}_RowCount`]: rowCount,
|
|
216
|
+
};
|
|
217
|
+
store.setFormdata((prev) => {
|
|
218
|
+
// we merge prev with newFormDataHolder immutably:
|
|
219
|
+
return { ...prev, ...newFormDataHolder }; // CHANGED: no in-place mutation
|
|
220
|
+
});
|
|
221
|
+
// formDataHolder[componentName] = handlerResponse.data?.data
|
|
222
|
+
// formDataHolder[`${componentName}_RowCount`] = handlerResponse.data?.meta?.totalRowCount
|
|
223
|
+
// store.setFormdata((pre) => { return { ...pre, ...formDataHolder } });
|
|
194
224
|
}
|
|
195
225
|
}
|
|
196
226
|
else {
|
|
197
227
|
if (handlerResponse) {
|
|
198
|
-
formDataHolder[componentName] = handlerResponse.data
|
|
199
|
-
store.setFormdata((pre) => { return { ...pre, ...formDataHolder } });
|
|
228
|
+
// formDataHolder[componentName] = handlerResponse.data
|
|
229
|
+
// store.setFormdata((pre) => { return { ...pre, ...formDataHolder } });
|
|
230
|
+
|
|
231
|
+
console.log("else part >>", handlerResponse);
|
|
232
|
+
const clonedData = _.cloneDeep(handlerResponse.data);
|
|
233
|
+
const newFormDataHolder = {
|
|
234
|
+
...formDataHolder,
|
|
235
|
+
[componentName]: clonedData,
|
|
236
|
+
};
|
|
237
|
+
|
|
238
|
+
store.setFormdata((prev) => ({ ...prev, ...newFormDataHolder }));
|
|
200
239
|
}
|
|
201
240
|
}
|
|
202
241
|
}
|
|
@@ -292,4 +331,8 @@ export function asyncOperation() {
|
|
|
292
331
|
}
|
|
293
332
|
}, 50);
|
|
294
333
|
});
|
|
295
|
-
}
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
function cloneDeep(data: any) {
|
|
337
|
+
throw new Error("Function not implemented.");
|
|
338
|
+
}
|
|
@@ -236,7 +236,7 @@ export default (funcParams: funcParamsProps) => {
|
|
|
236
236
|
onKeyDown: function () {
|
|
237
237
|
this.callHandler("onKeyDown")
|
|
238
238
|
},
|
|
239
|
-
onFileDelete: function () {
|
|
239
|
+
onFileDelete: async function () {
|
|
240
240
|
this.callHandler("onFileDelete")
|
|
241
241
|
},
|
|
242
242
|
onMount: function () {
|