impaktapps-ui-builder 0.0.409-r → 0.0.409-t
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 +22 -11
- 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/builder/build/buildUiSchema.ts +1 -77
- package/src/impaktapps-ui-builder/builder/build/uischema/coreSection.ts +4 -4
- package/src/impaktapps-ui-builder/builder/elements/UiSchema/Component/uiSchema.ts +4 -4
- package/src/impaktapps-ui-builder/builder/services/pageMaster.ts +1 -1
- package/src/impaktapps-ui-builder/runtime/services/events.ts +1 -0
- package/src/impaktapps-ui-builder/runtime/services/service.ts +13 -3
package/package.json
CHANGED
|
@@ -358,80 +358,4 @@ const buildUiSchema = (config: any) => {
|
|
|
358
358
|
}
|
|
359
359
|
|
|
360
360
|
|
|
361
|
-
export default buildUiSchema;
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
function nodeProvider(element, sizeMap) {
|
|
391
|
-
if (element.type) {
|
|
392
|
-
return {
|
|
393
|
-
accessorKey: element.name,
|
|
394
|
-
type: element.columnFormat,
|
|
395
|
-
header: element.label || element.name,
|
|
396
|
-
size: sizeMap[element.name] || 180,
|
|
397
|
-
widget: buildUiSchema(element)
|
|
398
|
-
|
|
399
|
-
};
|
|
400
|
-
}
|
|
401
|
-
return {
|
|
402
|
-
accessorKey: element.name,
|
|
403
|
-
type: element.columnFormat,
|
|
404
|
-
header: element.label || element.name,
|
|
405
|
-
size: sizeMap[element.name] || 180,
|
|
406
|
-
}
|
|
407
|
-
}
|
|
408
|
-
|
|
409
|
-
function buildHierarchy(elements, parentName = null, sizeMap) {
|
|
410
|
-
const result = [];
|
|
411
|
-
for (const element of elements) {
|
|
412
|
-
if (element?.parent === parentName) {
|
|
413
|
-
const children = buildHierarchy(elements, element.name, sizeMap);
|
|
414
|
-
const node: any = nodeProvider(element, sizeMap)
|
|
415
|
-
if (children.length > 0) {
|
|
416
|
-
node.columns = children;
|
|
417
|
-
node.type = "group";
|
|
418
|
-
}
|
|
419
|
-
result.push(node);
|
|
420
|
-
}
|
|
421
|
-
}
|
|
422
|
-
return result;
|
|
423
|
-
}
|
|
424
|
-
|
|
425
|
-
function transformConfigToOutput(config, sizeMap) {
|
|
426
|
-
const output = [];
|
|
427
|
-
const hierarchy = buildHierarchy(config.elements, config.name, schema);
|
|
428
|
-
for (const element of config.elements) {
|
|
429
|
-
const parentExists = config.elements.some(e => e.name === element.parent);
|
|
430
|
-
if (!parentExists && element.parent !== config.name) {
|
|
431
|
-
output.push(nodeProvider(element, sizeMap))
|
|
432
|
-
}
|
|
433
|
-
}
|
|
434
|
-
return [...hierarchy, ...output,];
|
|
435
|
-
}
|
|
436
|
-
|
|
437
|
-
|
|
361
|
+
export default buildUiSchema;
|
|
@@ -25,7 +25,7 @@ export default (funcParams: funcParamsProps) => {
|
|
|
25
25
|
},
|
|
26
26
|
getFormdata: async function () {
|
|
27
27
|
const id = store.searchParams?.get("id");
|
|
28
|
-
const config: any = await funcParams.pageConfigProvider()
|
|
28
|
+
const config: any = await funcParams.pageConfigProvider(id)
|
|
29
29
|
const formData = getFormdataFromLocalStorage()
|
|
30
30
|
if (formData) {
|
|
31
31
|
return formData;
|
|
@@ -21,7 +21,7 @@ interface funcParamsProps {
|
|
|
21
21
|
pageDataProvider: any,
|
|
22
22
|
functionsProvider?: Record<string, any>
|
|
23
23
|
}
|
|
24
|
-
|
|
24
|
+
let pageData: any = false;
|
|
25
25
|
export const extractEvents = (eventConfig: any) => {
|
|
26
26
|
function extractsConfigEvents(eventConfigObj: any) {
|
|
27
27
|
if (eventConfigObj.events) {
|
|
@@ -39,9 +39,15 @@ export const extractEvents = (eventConfig: any) => {
|
|
|
39
39
|
return elem.eventType === "Success"
|
|
40
40
|
})
|
|
41
41
|
if (!(!!SuccessEvent) && event.eventType === "onLoad") {
|
|
42
|
+
if (!(!!event.events)) {
|
|
43
|
+
event.events = [];
|
|
44
|
+
}
|
|
42
45
|
event.events.push({ Handler: "mergeFormdata", eventType: "Success", type: compType, lazyLoading: eventConfig.lazyLoading === "YES" ? true : false })
|
|
43
46
|
}
|
|
44
47
|
if (!(!!SuccessEvent) && (event.eventType === "onBack" || event.eventType === "onNext" || event.eventType === "onReset")) {
|
|
48
|
+
if (!(!!event.events)) {
|
|
49
|
+
event.events = [];
|
|
50
|
+
}
|
|
45
51
|
event.events.push({ Handler: `${event.eventType}Handler`, eventType: "Success", type: compType, lazyLoading: eventConfig.lazyLoading === "YES" ? true : false })
|
|
46
52
|
}
|
|
47
53
|
eventGroups[event.eventType][eventConfigObj.name].push({ ...event, type: compType })
|
|
@@ -56,6 +62,11 @@ export const extractEvents = (eventConfig: any) => {
|
|
|
56
62
|
return eventGroups;
|
|
57
63
|
};
|
|
58
64
|
export default (funcParams: funcParamsProps) => {
|
|
65
|
+
if (pageData) {
|
|
66
|
+
if ((!isEmpty(pageData)) && typeof pageData === "object") {
|
|
67
|
+
eventGroups = extractEvents(pageData?.config)
|
|
68
|
+
}
|
|
69
|
+
}
|
|
59
70
|
let executeEventsParameters: handlersProps = {
|
|
60
71
|
config: {}, componentName: "",
|
|
61
72
|
store: funcParams.store, dynamicData: funcParams.dynamicData, userValue: funcParams.userValue, service: funcParams.service,
|
|
@@ -66,12 +77,11 @@ export default (funcParams: funcParamsProps) => {
|
|
|
66
77
|
setPage: async function () {
|
|
67
78
|
funcParams.store.setFormdata({})
|
|
68
79
|
|
|
69
|
-
let pageData;
|
|
70
80
|
const pageBasicDetailString = localStorage.getItem("pagemasterMetaData")
|
|
71
81
|
if (pageBasicDetailString) {
|
|
72
82
|
pageData = JSON.parse(pageBasicDetailString)
|
|
73
83
|
} else {
|
|
74
|
-
pageData =
|
|
84
|
+
pageData = await funcParams.pageDataProvider();
|
|
75
85
|
localStorage.setItem("pagemasterMetaData", JSON.stringify({
|
|
76
86
|
schema: pageData?.schema,
|
|
77
87
|
uiSchema: pageData?.uiSchema, config: pageData?.config
|