impaktapps-ui-builder 0.0.382460 → 1.0.1
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 +1273 -1115
- package/dist/impaktapps-ui-builder.es.js.map +1 -1
- package/dist/impaktapps-ui-builder.umd.js +16 -16
- package/dist/impaktapps-ui-builder.umd.js.map +1 -1
- package/dist/src/impaktapps-ui-builder/builder/build/uischema/apiSection.d.ts +62 -59
- package/dist/src/impaktapps-ui-builder/builder/build/uischema/buildPropertiesSection.d.ts +17 -21
- package/dist/src/impaktapps-ui-builder/builder/build/uischema/card.d.ts +10 -2
- package/dist/src/impaktapps-ui-builder/builder/build/uischema/coreSection.d.ts +23 -32
- package/dist/src/impaktapps-ui-builder/builder/build/uischema/eventSection.d.ts +26 -33
- package/dist/src/impaktapps-ui-builder/builder/build/uischema/refresh.d.ts +52 -38
- package/dist/src/impaktapps-ui-builder/builder/build/uischema/styleSection.d.ts +7 -8
- package/dist/src/impaktapps-ui-builder/builder/build/uischema/table.d.ts +1 -0
- package/dist/src/impaktapps-ui-builder/builder/build/uischema/tableSection.d.ts +29 -33
- package/dist/src/impaktapps-ui-builder/builder/build/uischema/validationSections.d.ts +6 -0
- package/dist/src/impaktapps-ui-builder/builder/build/uischema/valueTab.d.ts +56 -36
- package/dist/src/impaktapps-ui-builder/builder/elements/UiSchema/event/schema.d.ts +6 -0
- package/dist/src/impaktapps-ui-builder/builder/services/component.d.ts +2 -0
- package/dist/src/impaktapps-ui-builder/builder/services/event.d.ts +8 -0
- package/dist/src/impaktapps-ui-builder/builder/services/utils.d.ts +1 -1
- package/package.json +1 -1
- package/src/impaktapps-ui-builder/builder/build/buildAadharCard.ts +2 -0
- package/src/impaktapps-ui-builder/builder/build/buildConfig.ts +6 -1
- package/src/impaktapps-ui-builder/builder/build/buildText.ts +21 -18
- package/src/impaktapps-ui-builder/builder/build/buildUiSchema.ts +39 -27
- package/src/impaktapps-ui-builder/builder/build/uischema/apiSection.ts +111 -96
- package/src/impaktapps-ui-builder/builder/build/uischema/buildPropertiesSection.ts +113 -61
- package/src/impaktapps-ui-builder/builder/build/uischema/card.ts +8 -4
- package/src/impaktapps-ui-builder/builder/build/uischema/coreSection.ts +108 -88
- package/src/impaktapps-ui-builder/builder/build/uischema/eventSection.ts +39 -17
- package/src/impaktapps-ui-builder/builder/build/uischema/refresh.ts +44 -44
- package/src/impaktapps-ui-builder/builder/build/uischema/styleSection.ts +9 -13
- package/src/impaktapps-ui-builder/builder/build/uischema/table.ts +1 -0
- package/src/impaktapps-ui-builder/builder/build/uischema/tableSection.ts +40 -18
- package/src/impaktapps-ui-builder/builder/build/uischema/validationSections.ts +73 -2
- package/src/impaktapps-ui-builder/builder/build/uischema/valueTab.ts +63 -45
- package/src/impaktapps-ui-builder/builder/elements/UiSchema/Component/schema.ts +50 -44
- package/src/impaktapps-ui-builder/builder/elements/UiSchema/Component/uiSchema.ts +232 -309
- package/src/impaktapps-ui-builder/builder/elements/UiSchema/PageMaster/uiSchema.ts +166 -224
- package/src/impaktapps-ui-builder/builder/elements/UiSchema/event/schema.ts +15 -12
- package/src/impaktapps-ui-builder/builder/elements/UiSchema/event/uiSchema.ts +147 -205
- package/src/impaktapps-ui-builder/builder/services/component.ts +228 -57
- package/src/impaktapps-ui-builder/builder/services/event.ts +182 -66
- package/src/impaktapps-ui-builder/builder/services/utils.ts +2 -2
- package/src/impaktapps-ui-builder/runtime/services/events.ts +32 -21
- package/src/impaktapps-ui-builder/runtime/services/service.ts +18 -29
|
@@ -1,158 +1,274 @@
|
|
|
1
1
|
import { EventSchema } from "../elements/UiSchema/event/schema";
|
|
2
2
|
import { EventUiSchema } from "../elements/UiSchema/event/uiSchema";
|
|
3
3
|
import Component from "./component";
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
okHandler,
|
|
6
|
+
saveFormdataInSessionStorage,
|
|
7
|
+
saveHandler,
|
|
8
|
+
getFormdataFromSessionStorage,
|
|
9
|
+
} from "./utils";
|
|
5
10
|
import { APISection } from "../build/uischema/apiSection";
|
|
6
|
-
import {
|
|
11
|
+
import {
|
|
12
|
+
emptyBox,
|
|
13
|
+
getRadioInputField,
|
|
14
|
+
getSelectField,
|
|
15
|
+
getTextArea,
|
|
16
|
+
} from "../build/uischema/buildPropertiesSection";
|
|
7
17
|
import { refreshSectionUiSchema } from "../build/uischema/refresh";
|
|
8
18
|
import _ from "lodash";
|
|
9
|
-
import emptyBox from "../build/uischema/emptyBox";
|
|
10
19
|
|
|
11
20
|
export default (
|
|
12
21
|
store: any,
|
|
13
22
|
dynamicData: any,
|
|
14
23
|
submitHandler: any,
|
|
15
24
|
service: any,
|
|
16
|
-
functionsName?: { const: string
|
|
25
|
+
functionsName?: { const: string; title: string }[]
|
|
17
26
|
) => {
|
|
18
27
|
return {
|
|
19
28
|
setPage: async function () {
|
|
20
29
|
const formdata = await this.getFormData();
|
|
21
30
|
store.setFormdata(formdata);
|
|
22
31
|
const schema = await this.getSchema();
|
|
32
|
+
console.log("SettingSchema>>",schema)
|
|
23
33
|
store.setSchema(schema);
|
|
24
|
-
this.refreshPage(formdata.Handler, store)
|
|
34
|
+
this.refreshPage(formdata.Handler, store);
|
|
25
35
|
},
|
|
26
36
|
refreshPage: (handlerType: any, store: any) => {
|
|
27
37
|
const uiSchema = _.cloneDeep(EventUiSchema(store.theme.myTheme));
|
|
28
|
-
const schema: any = _.cloneDeep(EventSchema)
|
|
38
|
+
const schema: any = _.cloneDeep(EventSchema);
|
|
29
39
|
if (handlerType) {
|
|
30
40
|
if (handlerType === "custom") {
|
|
31
|
-
uiSchema.elements[
|
|
32
|
-
|
|
41
|
+
uiSchema.elements[0].elements[0].elements[2] = getRadioInputField(
|
|
42
|
+
"isSync",
|
|
43
|
+
"Run in Sync",
|
|
44
|
+
["Yes", "No"]
|
|
45
|
+
);
|
|
46
|
+
uiSchema.elements[0].elements[0].elements[3] = {
|
|
33
47
|
type: "Control",
|
|
34
48
|
scope: "#/properties/emptyBox",
|
|
35
49
|
options: {
|
|
36
50
|
widget: "EmptyBox",
|
|
37
51
|
},
|
|
38
|
-
|
|
52
|
+
|
|
39
53
|
config: {
|
|
40
|
-
layout: { xs:
|
|
54
|
+
layout: { xs: 6, sm: 6, md: 0, lg: 3 },
|
|
41
55
|
main: {},
|
|
42
|
-
style:{}
|
|
56
|
+
style: {},
|
|
43
57
|
},
|
|
44
58
|
};
|
|
45
|
-
uiSchema.elements[
|
|
46
|
-
|
|
47
|
-
|
|
59
|
+
uiSchema.elements[0].elements[0].elements[4] = getTextArea(
|
|
60
|
+
"eventCode",
|
|
61
|
+
"Write Custom Code",
|
|
62
|
+
false
|
|
63
|
+
);
|
|
64
|
+
schema.required = ["eventType", "Handler", "eventCode"];
|
|
48
65
|
} else if (handlerType === "api") {
|
|
49
|
-
uiSchema.elements[
|
|
50
|
-
|
|
51
|
-
|
|
66
|
+
uiSchema.elements[0].elements[0].elements[2] = emptyBox("emptyBox", {
|
|
67
|
+
xs: 0,
|
|
68
|
+
sm: 0,
|
|
69
|
+
md: 4,
|
|
70
|
+
lg: 6,
|
|
71
|
+
});
|
|
72
|
+
uiSchema.elements[0].elements[0].elements[3] = APISection;
|
|
73
|
+
schema.required = ["eventType", "Handler", "method", "path"];
|
|
52
74
|
} else if (handlerType === "inBuiltFunction") {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
75
|
+
uiSchema.elements[0].elements[0].elements[2] = getSelectField(
|
|
76
|
+
"inBuiltFunctionType",
|
|
77
|
+
"Function Name",
|
|
78
|
+
[
|
|
79
|
+
{ label: "RankProvider", value: "RankProvider" },
|
|
80
|
+
{ label: "Download File", value: "downloadFile" },
|
|
81
|
+
{ label: "Download Blob File", value: "downloadBlobFile" },
|
|
82
|
+
]
|
|
83
|
+
);
|
|
84
|
+
uiSchema.elements[0].elements[0].elements[3] = {
|
|
60
85
|
type: "Control",
|
|
61
86
|
scope: "#/properties/emptyBox",
|
|
62
87
|
options: {
|
|
63
88
|
widget: "EmptyBox",
|
|
64
89
|
},
|
|
65
|
-
|
|
90
|
+
|
|
66
91
|
config: {
|
|
67
|
-
layout: { xs: 6, sm: 6, md: 0, lg:
|
|
92
|
+
layout: { xs: 6, sm: 6, md: 0, lg: 3 },
|
|
68
93
|
main: {},
|
|
69
|
-
style:{}
|
|
94
|
+
style: {},
|
|
70
95
|
},
|
|
71
96
|
};
|
|
72
|
-
uiSchema.elements[
|
|
73
|
-
|
|
97
|
+
uiSchema.elements[0].elements[0].elements[4] = getTextArea(
|
|
98
|
+
"funcParametersCode",
|
|
99
|
+
"Write Custom Code for Functions Parameter",
|
|
100
|
+
true
|
|
101
|
+
);
|
|
102
|
+
schema.required = ["eventType", "Handler", "inBuiltFunctionType"];
|
|
74
103
|
} else if (handlerType === "refresh") {
|
|
75
|
-
uiSchema.elements[
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
104
|
+
uiSchema.elements[0].elements[0].elements[2] = emptyBox("emptyBox", {
|
|
105
|
+
xs: 0,
|
|
106
|
+
sm: 0,
|
|
107
|
+
md: 4,
|
|
108
|
+
lg: 6,
|
|
109
|
+
});
|
|
110
|
+
uiSchema.elements[0].elements[0].elements[3] = refreshSectionUiSchema;
|
|
111
|
+
schema.properties.refreshElements.required = ["value"];
|
|
112
|
+
schema.properties.refreshElements.items.required = ["value"];
|
|
113
|
+
schema.required = ["eventType", "Handler", "refreshElements"];
|
|
80
114
|
}
|
|
81
115
|
}
|
|
82
116
|
if (functionsName) {
|
|
83
117
|
schema.properties.inBuiltFunctionType.oneOf = [
|
|
84
118
|
...schema.properties.inBuiltFunctionType.oneOf,
|
|
85
|
-
...functionsName
|
|
86
|
-
]
|
|
119
|
+
...functionsName,
|
|
120
|
+
];
|
|
87
121
|
}
|
|
88
|
-
if (sessionStorage.getItem("copiedConfig")
|
|
89
|
-
Component(store, dynamicData, submitHandler, service).ElementPathSetter(
|
|
122
|
+
if (sessionStorage.getItem("copiedConfig")) {
|
|
123
|
+
Component(store, dynamicData, submitHandler, service).ElementPathSetter(
|
|
124
|
+
uiSchema
|
|
125
|
+
);
|
|
90
126
|
schema.properties.RemoveItemButton.disabled = false;
|
|
91
127
|
}
|
|
92
|
-
|
|
93
|
-
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
const config = JSON.parse(sessionStorage.getItem("pageFormdata"));
|
|
131
|
+
const path = store.searchParams?.get("path");
|
|
132
|
+
const id = store.searchParams?.get("id");
|
|
133
|
+
|
|
134
|
+
let pathArray = [{label: config.name ?? "NewPage", path: `/PageMaster${id ? `?id=${id}` : ''}`}];
|
|
135
|
+
|
|
136
|
+
if (path) {
|
|
137
|
+
const pathArrayAll = path.split(".");
|
|
138
|
+
const arr: any = [];
|
|
139
|
+
pathArrayAll.map((e: string, i: number) => {
|
|
140
|
+
if (i === 0) {
|
|
141
|
+
arr.push(e);
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
144
|
+
arr.push(`${arr[i - 1]}.${e}`);
|
|
145
|
+
});
|
|
146
|
+
|
|
147
|
+
arr.map((e) => {
|
|
148
|
+
const data = _.get(config, e);
|
|
149
|
+
pathArray.push({
|
|
150
|
+
label: data?.name || data?.eventType || "NewComponent",
|
|
151
|
+
path: data?.eventType ? `/ComponentEvents?path=${e}${id ? `&id=${id}` : ''}` : `/Component?path=${e}${id ? `&id=${id}` : ''}`,
|
|
152
|
+
});
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
schema.properties.pageName.path = pathArray;
|
|
156
|
+
store.setSchema(schema);
|
|
157
|
+
store.setUiSchema(uiSchema);
|
|
94
158
|
},
|
|
95
159
|
|
|
96
|
-
getFormData: Component(store, dynamicData, submitHandler, service)
|
|
160
|
+
getFormData: Component(store, dynamicData, submitHandler, service)
|
|
161
|
+
.getFormdata,
|
|
97
162
|
getUiSchema: function () {
|
|
98
163
|
return EventUiSchema;
|
|
99
164
|
},
|
|
100
165
|
getSchema: () => {
|
|
101
166
|
const schema = _.cloneDeep(EventSchema);
|
|
102
|
-
if (sessionStorage.getItem("copiedConfig")
|
|
167
|
+
if (sessionStorage.getItem("copiedConfig")) {
|
|
103
168
|
schema.properties.RemoveItemButton.disabled = false;
|
|
104
169
|
}
|
|
170
|
+
|
|
171
|
+
const config = JSON.parse(sessionStorage.getItem("pageFormdata"));
|
|
172
|
+
const path = store.searchParams?.get("path");
|
|
173
|
+
const id = store.searchParams?.get("id");
|
|
174
|
+
|
|
175
|
+
let pathArray = [{label: config.name ?? "NewPage", path: `/PageMaster${id ? `?id=${id}` : ''}`}];
|
|
176
|
+
|
|
177
|
+
if (path) {
|
|
178
|
+
const pathArrayAll = path.split(".");
|
|
179
|
+
const arr: any = [];
|
|
180
|
+
pathArrayAll.map((e: string, i: number) => {
|
|
181
|
+
if (i === 0) {
|
|
182
|
+
arr.push(e);
|
|
183
|
+
return;
|
|
184
|
+
}
|
|
185
|
+
arr.push(`${arr[i - 1]}.${e}`);
|
|
186
|
+
});
|
|
187
|
+
|
|
188
|
+
arr.map((e) => {
|
|
189
|
+
const data = _.get(config, e);
|
|
190
|
+
pathArray.push({
|
|
191
|
+
label: data?.name || data?.eventType || "NewComponent",
|
|
192
|
+
path: data?.eventType ? `/ComponentEvents?path=${e}${id ? `&id=${id}` : ''}` : `/Component?path=${e}${id ? `&id=${id}` : ''}`,
|
|
193
|
+
});
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
schema.properties.pageName.path = _.cloneDeep(pathArray);
|
|
105
197
|
return schema;
|
|
106
198
|
},
|
|
107
199
|
okHandler: () => okHandler(store),
|
|
108
|
-
saveHandler: async () => await saveHandler(store, service, submitHandler
|
|
200
|
+
saveHandler: async () => await saveHandler(store, service, submitHandler),
|
|
109
201
|
onChange: function () {
|
|
110
202
|
if (
|
|
111
203
|
store?.formData?.Handler !== store?.newData?.Handler &&
|
|
112
204
|
store?.newData?.Handler !== undefined
|
|
113
205
|
) {
|
|
114
|
-
this.refreshPage(
|
|
206
|
+
this.refreshPage(
|
|
207
|
+
store.newData.Handler || store.formdata.Handler,
|
|
208
|
+
store
|
|
209
|
+
);
|
|
115
210
|
}
|
|
116
211
|
},
|
|
117
212
|
addEvent: function () {
|
|
118
213
|
const path = store.searchParams?.get("path");
|
|
119
214
|
if (!Array.isArray(store.formData.events)) {
|
|
120
|
-
store.formData.events = []
|
|
215
|
+
store.formData.events = [];
|
|
121
216
|
}
|
|
122
|
-
saveFormdataInSessionStorage(store.ctx.core.data, path)
|
|
123
|
-
const finalPath = `${path}.events[${store.formData?.events?.length}]
|
|
124
|
-
store.searchParams.set("path", finalPath)
|
|
125
|
-
store.setSearchParams(store.searchParams)
|
|
126
|
-
this.setPage()
|
|
217
|
+
saveFormdataInSessionStorage(store.ctx.core.data, path);
|
|
218
|
+
const finalPath = `${path}.events[${store.formData?.events?.length}]`;
|
|
219
|
+
store.searchParams.set("path", finalPath);
|
|
220
|
+
store.setSearchParams(store.searchParams);
|
|
221
|
+
this.setPage();
|
|
127
222
|
},
|
|
128
223
|
editEvent: function () {
|
|
129
224
|
const rowId = dynamicData.path.split(".")[1];
|
|
130
225
|
const path = store.searchParams?.get("path");
|
|
131
|
-
saveFormdataInSessionStorage(store.ctx.core.data, path)
|
|
132
|
-
const finalPath = `${path}.events[${rowId}]
|
|
133
|
-
store.searchParams.set("path", finalPath)
|
|
134
|
-
store.setSearchParams(store.searchParams)
|
|
135
|
-
this.setPage()
|
|
136
|
-
|
|
226
|
+
saveFormdataInSessionStorage(store.ctx.core.data, path);
|
|
227
|
+
const finalPath = `${path}.events[${rowId}]`;
|
|
228
|
+
store.searchParams.set("path", finalPath);
|
|
229
|
+
store.setSearchParams(store.searchParams);
|
|
230
|
+
this.setPage();
|
|
137
231
|
},
|
|
138
232
|
deleteEvent: async function () {
|
|
139
|
-
await Component(store, dynamicData, submitHandler, service).deleteEvent(
|
|
233
|
+
await Component(store, dynamicData, submitHandler, service).deleteEvent(
|
|
234
|
+
false
|
|
235
|
+
);
|
|
140
236
|
store.updateDialog("popUpEvent");
|
|
141
237
|
},
|
|
142
238
|
backHandler: function () {
|
|
143
|
-
store.navigate(-1)
|
|
239
|
+
store.navigate(-1);
|
|
144
240
|
},
|
|
145
|
-
deletePopUpEvent: function(){
|
|
241
|
+
deletePopUpEvent: function () {
|
|
146
242
|
const rowId = dynamicData.path.split(".")[1];
|
|
147
|
-
sessionStorage.setItem(
|
|
243
|
+
sessionStorage.setItem("rowId", rowId);
|
|
148
244
|
store.updateDialog("popUpEvent");
|
|
149
245
|
},
|
|
150
|
-
copyPasteElement:
|
|
151
|
-
Component(store, dynamicData, submitHandler, service).copyPasteElement(
|
|
246
|
+
copyPasteElement: function () {
|
|
247
|
+
Component(store, dynamicData, submitHandler, service).copyPasteElement(
|
|
248
|
+
store,
|
|
249
|
+
this.setPage.bind(this)
|
|
250
|
+
);
|
|
152
251
|
},
|
|
153
|
-
RemoveItemButton: function(){
|
|
154
|
-
Component(store, dynamicData, submitHandler, service).RemoveItemButton(
|
|
252
|
+
RemoveItemButton: function () {
|
|
253
|
+
Component(store, dynamicData, submitHandler, service).RemoveItemButton(
|
|
254
|
+
store
|
|
255
|
+
);
|
|
155
256
|
},
|
|
156
|
-
|
|
157
|
-
|
|
257
|
+
onNavigatePopupYes: function() {
|
|
258
|
+
try{
|
|
259
|
+
store.navigate(sessionStorage.getItem("pendingNavigatePath"))
|
|
260
|
+
store.updateDialog(`pageNamepopup`)
|
|
261
|
+
}
|
|
262
|
+
catch(e){
|
|
263
|
+
store.updateDialog(`pageNamepopup`)
|
|
264
|
+
store.setNotify({
|
|
265
|
+
FailMessage: "Couldn't navigate page",
|
|
266
|
+
Fail: true,
|
|
267
|
+
})
|
|
268
|
+
}
|
|
269
|
+
},
|
|
270
|
+
onNavigatePopupNo: function() {
|
|
271
|
+
store.updateDialog(`pageNamepopup`)
|
|
272
|
+
}
|
|
273
|
+
};
|
|
158
274
|
};
|
|
@@ -57,7 +57,7 @@ export const getFormdataFromSessionStorage = (path?: string) => {
|
|
|
57
57
|
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
-
export async function saveHandler(store, service, submitHandler
|
|
60
|
+
export async function saveHandler(store, service, submitHandler) {
|
|
61
61
|
const id = store.searchParams?.get("id");
|
|
62
62
|
const path = store.searchParams?.get("path");
|
|
63
63
|
saveFormdataInSessionStorage(store.ctx.core.data, path);
|
|
@@ -65,7 +65,7 @@ export async function saveHandler(store, service, submitHandler, pageName?: stri
|
|
|
65
65
|
if (_.isEmpty(store.ctx.core.errors)) {
|
|
66
66
|
try {
|
|
67
67
|
const saveReturn = await submitHandler(store, service, config);
|
|
68
|
-
navigateHandler(store, true,
|
|
68
|
+
navigateHandler(store, true,"/PageMasterRecords")
|
|
69
69
|
} catch (err) {
|
|
70
70
|
navigateHandler(store, false)
|
|
71
71
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import _
|
|
1
|
+
import _ from "lodash";
|
|
2
2
|
import { handlersProps } from "./interface";
|
|
3
3
|
export const executeEvents = (params: handlersProps) => {
|
|
4
4
|
let nextEvent = [];
|
|
@@ -146,32 +146,36 @@ function executeCustomHandler(params: handlersProps) {
|
|
|
146
146
|
}
|
|
147
147
|
|
|
148
148
|
function mergeFormdata(handlerResponse: any, componentName: string, eventConfig: any, store: any, service: any, formDataHolder: any) {
|
|
149
|
-
if (eventConfig.type === "Select"
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
...pre
|
|
154
|
-
...pre.properties
|
|
155
|
-
|
|
149
|
+
if (eventConfig.type === "Select" && handlerResponse?.data) {
|
|
150
|
+
if (!_.isEmpty(handlerResponse?.data)) {
|
|
151
|
+
store.setSchema((pre) => {
|
|
152
|
+
return {
|
|
153
|
+
...pre, properties: {
|
|
154
|
+
...pre.properties, [componentName]: {
|
|
155
|
+
...pre.properties?.[componentName],
|
|
156
|
+
oneOf: handlerResponse.data
|
|
157
|
+
}
|
|
156
158
|
}
|
|
157
159
|
}
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
+
})
|
|
161
|
+
}
|
|
160
162
|
}
|
|
161
|
-
else if (eventConfig.type === "MultipleSelect" && handlerResponse?.data
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
...pre
|
|
166
|
-
...pre.properties
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
163
|
+
else if (eventConfig.type === "MultipleSelect" && handlerResponse?.data) {
|
|
164
|
+
if (!_.isEmpty(handlerResponse?.data)) {
|
|
165
|
+
store.setSchema((pre) => {
|
|
166
|
+
return {
|
|
167
|
+
...pre, properties: {
|
|
168
|
+
...pre.properties, [componentName]: {
|
|
169
|
+
...pre.properties?.[componentName],
|
|
170
|
+
type: "array",
|
|
171
|
+
items: {
|
|
172
|
+
oneOf: handlerResponse?.data
|
|
173
|
+
}
|
|
170
174
|
}
|
|
171
175
|
}
|
|
172
176
|
}
|
|
173
|
-
}
|
|
174
|
-
}
|
|
177
|
+
})
|
|
178
|
+
}
|
|
175
179
|
}
|
|
176
180
|
else if (eventConfig.type === "page") {
|
|
177
181
|
if (!(_.isEmpty(handlerResponse?.data) && handlerResponse?.data)) {
|
|
@@ -182,6 +186,13 @@ function mergeFormdata(handlerResponse: any, componentName: string, eventConfig:
|
|
|
182
186
|
store.setFormdata((pre: any) => { return { ...pre, ...handlerResponse?.data } })
|
|
183
187
|
}
|
|
184
188
|
}
|
|
189
|
+
else if (eventConfig.type === "Table" && eventConfig.lazyLoading) {
|
|
190
|
+
if (handlerResponse && handlerResponse?.data) {
|
|
191
|
+
formDataHolder[componentName] = handlerResponse.data?.data
|
|
192
|
+
formDataHolder[`${componentName}_RowCount`] = handlerResponse.data?.meta?.totalRowCount
|
|
193
|
+
store.setFormdata((pre) => { return { ...pre, ...formDataHolder } });
|
|
194
|
+
}
|
|
195
|
+
}
|
|
185
196
|
else {
|
|
186
197
|
if (handlerResponse) {
|
|
187
198
|
formDataHolder[componentName] = handlerResponse.data
|
|
@@ -61,33 +61,21 @@ export const extractEvents = (eventConfig: any) => {
|
|
|
61
61
|
return eventGroups;
|
|
62
62
|
};
|
|
63
63
|
export default (funcParams: funcParamsProps) => {
|
|
64
|
-
eventGroups = {}
|
|
65
64
|
const formDataHolder = {}
|
|
66
|
-
if (pageData) {
|
|
67
|
-
if ((!isEmpty(pageData)) && typeof pageData === "object") {
|
|
68
|
-
eventGroups = extractEvents(pageData?.config)
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
65
|
let executeEventsParameters: handlersProps = {
|
|
72
66
|
config: {}, componentName: "",
|
|
73
67
|
store: funcParams.store, dynamicData: funcParams.dynamicData, userValue: funcParams.userValue, service: funcParams.service,
|
|
74
|
-
serviceHolder: { downloadFile, download: doDownload, ...funcParams.functionsProvider },
|
|
68
|
+
serviceHolder: { downloadFile, download: doDownload, ...funcParams.functionsProvider },eventGroups,
|
|
75
69
|
functionsProvider: funcParams.functionsProvider, formDataHolder
|
|
76
70
|
};
|
|
77
71
|
return {
|
|
78
72
|
setPage: async function () {
|
|
73
|
+
funcParams.store.setAdditionalErrors([]);
|
|
79
74
|
funcParams.store.setFormdata({});
|
|
75
|
+
funcParams.store.setSchema({ type: "object", properties: {} });
|
|
80
76
|
funcParams.store.newData = {};
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
pageData = JSON.parse(pageBasicDetailString)
|
|
84
|
-
} else {
|
|
85
|
-
pageData = await funcParams.pageDataProvider();
|
|
86
|
-
sessionStorage.setItem("pagemasterMetaData", JSON.stringify({
|
|
87
|
-
schema: pageData?.schema,
|
|
88
|
-
uiSchema: pageData?.uiSchema, config: pageData?.config
|
|
89
|
-
}))
|
|
90
|
-
}
|
|
77
|
+
eventGroups = {};
|
|
78
|
+
pageData = await funcParams.pageDataProvider();
|
|
91
79
|
const config = pageData?.config;
|
|
92
80
|
const uiSchema = pageData?.uiSchema;
|
|
93
81
|
const event = new CustomEvent('pageNameChanged', {
|
|
@@ -96,7 +84,6 @@ export default (funcParams: funcParamsProps) => {
|
|
|
96
84
|
window.dispatchEvent(event)
|
|
97
85
|
const theme = funcParams?.store?.theme?.myTheme;
|
|
98
86
|
uiSchema.elements.push(
|
|
99
|
-
|
|
100
87
|
{
|
|
101
88
|
type: "HorizontalLayout",
|
|
102
89
|
config: {
|
|
@@ -126,7 +113,7 @@ export default (funcParams: funcParamsProps) => {
|
|
|
126
113
|
},
|
|
127
114
|
style: {
|
|
128
115
|
color: theme?.palette?.text?.disabled || "#AFAFAF",
|
|
129
|
-
fontSize: "
|
|
116
|
+
fontSize: "11px",
|
|
130
117
|
textAlign: "center",
|
|
131
118
|
lineHeight: 2,
|
|
132
119
|
width: "fit-content",
|
|
@@ -155,7 +142,6 @@ export default (funcParams: funcParamsProps) => {
|
|
|
155
142
|
fill: theme?.palette?.primary?.main,
|
|
156
143
|
width: 20,
|
|
157
144
|
height: 0,
|
|
158
|
-
// margin: 0,
|
|
159
145
|
top: 0,
|
|
160
146
|
right: { xs: "12px", sm: "84px" },
|
|
161
147
|
position: "absolute",
|
|
@@ -164,7 +150,7 @@ export default (funcParams: funcParamsProps) => {
|
|
|
164
150
|
":hover": {
|
|
165
151
|
fill: theme?.palette?.primary?.dark,
|
|
166
152
|
},
|
|
167
|
-
marginRight: "
|
|
153
|
+
marginRight: "20px",
|
|
168
154
|
},
|
|
169
155
|
},
|
|
170
156
|
},
|
|
@@ -186,10 +172,10 @@ export default (funcParams: funcParamsProps) => {
|
|
|
186
172
|
height: 0,
|
|
187
173
|
width: "fit-content",
|
|
188
174
|
color: theme?.palette?.primary?.main,
|
|
189
|
-
fontSize: "
|
|
175
|
+
fontSize: "12px",
|
|
190
176
|
cursor: "pointer",
|
|
191
177
|
marginLeft: "2px",
|
|
192
|
-
|
|
178
|
+
|
|
193
179
|
top: 3,
|
|
194
180
|
right: "12px",
|
|
195
181
|
position: "absolute",
|
|
@@ -204,22 +190,24 @@ export default (funcParams: funcParamsProps) => {
|
|
|
204
190
|
}
|
|
205
191
|
);
|
|
206
192
|
const schema = pageData?.schema ?? { type: "object", properties: {} };
|
|
207
|
-
|
|
193
|
+
const newEventGroups = extractEvents(config);
|
|
194
|
+
console.log("newEventGroups", newEventGroups,eventGroups)
|
|
195
|
+
eventGroups = newEventGroups;
|
|
208
196
|
executeEventsParameters = {
|
|
209
197
|
config: {}, componentName: "",
|
|
210
198
|
store: funcParams.store, dynamicData: funcParams.dynamicData, userValue: funcParams.userValue, service: funcParams.service,
|
|
211
199
|
functionsProvider: funcParams.functionsProvider,
|
|
212
|
-
serviceHolder: this, eventGroups, formDataHolder
|
|
200
|
+
serviceHolder: this, eventGroups: newEventGroups, formDataHolder
|
|
213
201
|
}
|
|
214
202
|
await executeRefreshHandler({
|
|
215
203
|
config: {}, componentName: "",
|
|
216
204
|
store: funcParams.store, dynamicData: funcParams.dynamicData, userValue: funcParams.userValue, service: funcParams.service,
|
|
217
|
-
serviceHolder: this, eventGroups, formDataHolder
|
|
205
|
+
serviceHolder: this, eventGroups: newEventGroups, formDataHolder: {}
|
|
218
206
|
})
|
|
219
207
|
funcParams.store.setSchema(
|
|
220
208
|
(pre: any) => {
|
|
221
209
|
return {
|
|
222
|
-
...schema
|
|
210
|
+
...schema, ...pre, properties:
|
|
223
211
|
{ ...schema.properties, ...pre.properties, }
|
|
224
212
|
}
|
|
225
213
|
}
|
|
@@ -231,7 +219,8 @@ export default (funcParams: funcParamsProps) => {
|
|
|
231
219
|
if (eventGroups.onCellRenderer) {
|
|
232
220
|
let finalResponse = {};
|
|
233
221
|
const path = funcParams.dynamicData?.tableButtonPath || funcParams?.dynamicData?.path?.split(".")[0];
|
|
234
|
-
|
|
222
|
+
|
|
223
|
+
for (const eventConfig of eventGroups?.onCellRenderer?.[path]) {
|
|
235
224
|
executeEventsParameters.store.functionParameters = cellParams
|
|
236
225
|
finalResponse = executeEvents({
|
|
237
226
|
...executeEventsParameters,
|
|
@@ -285,7 +274,7 @@ export default (funcParams: funcParamsProps) => {
|
|
|
285
274
|
{ key: "searchValue", value: param.serachValue },
|
|
286
275
|
{ key: "currentValue", value: param.currentValue }
|
|
287
276
|
]
|
|
288
|
-
const response = await this.callExecuteEvents(param, apiBody);
|
|
277
|
+
const response = await this.callExecuteEvents(param, apiBody, "onLoad");
|
|
289
278
|
return response?.data;
|
|
290
279
|
}
|
|
291
280
|
},
|