impaktapps-ui-builder 0.0.409-p → 0.0.409-r
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 +19 -39
- package/dist/impaktapps-ui-builder.es.js.map +1 -1
- package/dist/impaktapps-ui-builder.umd.js +6 -6
- package/dist/impaktapps-ui-builder.umd.js.map +1 -1
- package/dist/src/impaktapps-ui-builder/builder/services/pageMaster.d.ts +1 -0
- package/dist/src/impaktapps-ui-builder/runtime/services/service.d.ts +1 -0
- package/package.json +1 -1
- package/src/impaktapps-ui-builder/builder/services/pageMaster.ts +4 -9
- package/src/impaktapps-ui-builder/runtime/services/service.ts +17 -31
package/package.json
CHANGED
|
@@ -8,12 +8,12 @@ import { getFormdataFromLocalStorage, saveFormdataInLocalStorage, saveHandler }
|
|
|
8
8
|
interface funcParamsProps {
|
|
9
9
|
store: any,
|
|
10
10
|
dynamicData: any,
|
|
11
|
-
|
|
11
|
+
pageConfigProvider: any,
|
|
12
12
|
submitHandler: any,
|
|
13
13
|
service: any
|
|
14
14
|
}
|
|
15
15
|
export default (funcParams: funcParamsProps) => {
|
|
16
|
-
const { store, dynamicData,
|
|
16
|
+
const { store, dynamicData, submitHandler, service } = funcParams
|
|
17
17
|
return {
|
|
18
18
|
setPage: async function () {
|
|
19
19
|
const formdata = await this.getFormdata();
|
|
@@ -25,12 +25,7 @@ export default (funcParams: funcParamsProps) => {
|
|
|
25
25
|
},
|
|
26
26
|
getFormdata: async function () {
|
|
27
27
|
const id = store.searchParams?.get("id");
|
|
28
|
-
|
|
29
|
-
if (id) {
|
|
30
|
-
await service.get(`/page/getById?id=${id}`).then((res: any) => {
|
|
31
|
-
config = res.data?.config;
|
|
32
|
-
});
|
|
33
|
-
}
|
|
28
|
+
const config: any = await funcParams.pageConfigProvider()
|
|
34
29
|
const formData = getFormdataFromLocalStorage()
|
|
35
30
|
if (formData) {
|
|
36
31
|
return formData;
|
|
@@ -58,7 +53,7 @@ export default (funcParams: funcParamsProps) => {
|
|
|
58
53
|
store.navigate(
|
|
59
54
|
`/Component?path=${`elements[${response?.elements.length}]`}&id=${id}`
|
|
60
55
|
);
|
|
61
|
-
}else{
|
|
56
|
+
} else {
|
|
62
57
|
store.navigate(
|
|
63
58
|
`/Component?path=${`elements[${response?.elements.length}]`}`
|
|
64
59
|
);
|
|
@@ -18,6 +18,7 @@ interface funcParamsProps {
|
|
|
18
18
|
dynamicData: any,
|
|
19
19
|
service: any,
|
|
20
20
|
userValue: any,
|
|
21
|
+
pageDataProvider: any,
|
|
21
22
|
functionsProvider?: Record<string, any>
|
|
22
23
|
}
|
|
23
24
|
|
|
@@ -64,29 +65,13 @@ export default (funcParams: funcParamsProps) => {
|
|
|
64
65
|
return {
|
|
65
66
|
setPage: async function () {
|
|
66
67
|
funcParams.store.setFormdata({})
|
|
67
|
-
|
|
68
|
-
pageName: funcParams.store.pageName
|
|
69
|
-
});
|
|
68
|
+
|
|
70
69
|
let pageData;
|
|
71
70
|
const pageBasicDetailString = localStorage.getItem("pagemasterMetaData")
|
|
72
71
|
if (pageBasicDetailString) {
|
|
73
72
|
pageData = JSON.parse(pageBasicDetailString)
|
|
74
73
|
} else {
|
|
75
|
-
|
|
76
|
-
.post("/page/getByName", data, {
|
|
77
|
-
headers: {
|
|
78
|
-
"Content-Type": "application/json",
|
|
79
|
-
},
|
|
80
|
-
});
|
|
81
|
-
const response = await funcParams.service.get(
|
|
82
|
-
`/page/getById?id=${pageId?.data?.id}`,
|
|
83
|
-
{
|
|
84
|
-
headers: {
|
|
85
|
-
"Content-Type": "application/json",
|
|
86
|
-
},
|
|
87
|
-
}
|
|
88
|
-
);
|
|
89
|
-
pageData = response.data;
|
|
74
|
+
pageData = await funcParams.pageDataProvider();
|
|
90
75
|
localStorage.setItem("pagemasterMetaData", JSON.stringify({
|
|
91
76
|
schema: pageData?.schema,
|
|
92
77
|
uiSchema: pageData?.uiSchema, config: pageData?.config
|
|
@@ -121,19 +106,20 @@ export default (funcParams: funcParamsProps) => {
|
|
|
121
106
|
|
|
122
107
|
},
|
|
123
108
|
onCellRenderer: (cellParams) => {
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
109
|
+
if (eventGroups.onCellRenderer) {
|
|
110
|
+
let finalResponse = {};
|
|
111
|
+
const path = funcParams.dynamicData?.tableButtonPath || funcParams?.dynamicData?.path?.split(".")[0];
|
|
112
|
+
for (const eventConfig of eventGroups?.onCellRenderer[path]) {
|
|
113
|
+
executeEventsParameters.store.functionParameters = cellParams
|
|
114
|
+
finalResponse = executeEvents({
|
|
115
|
+
...executeEventsParameters,
|
|
116
|
+
config: eventConfig,
|
|
117
|
+
componentName: path
|
|
118
|
+
})
|
|
119
|
+
}
|
|
120
|
+
return finalResponse
|
|
134
121
|
}
|
|
135
|
-
|
|
136
|
-
return finalResponse
|
|
122
|
+
return {}
|
|
137
123
|
},
|
|
138
124
|
onClick: function () {
|
|
139
125
|
this.callHandler("onClick")
|
|
@@ -237,7 +223,7 @@ export default (funcParams: funcParamsProps) => {
|
|
|
237
223
|
if (eventGroups?.[eventType]?.[path] !== undefined) {
|
|
238
224
|
for (const eventConfig of eventGroups?.[eventType]?.[path]) {
|
|
239
225
|
executeEventsParameters.store.functionParameters = functionParameters
|
|
240
|
-
|
|
226
|
+
executeEvents({
|
|
241
227
|
...executeEventsParameters,
|
|
242
228
|
config: eventConfig,
|
|
243
229
|
componentName: path
|