impaktapps-ui-builder 0.0.101-alpha.35 → 0.0.101-alpha.351
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 +329 -113
- package/dist/impaktapps-ui-builder.es.js.map +1 -1
- package/dist/impaktapps-ui-builder.umd.js +15 -15
- package/dist/impaktapps-ui-builder.umd.js.map +1 -1
- package/dist/src/impaktapps-ui-builder/builder/elements/UiSchema/event/schema.d.ts +6 -0
- package/dist/src/impaktapps-ui-builder/builder/services/event.d.ts +6 -0
- package/package.json +1 -1
- package/src/impaktapps-ui-builder/builder/build/buildText.ts +21 -18
- package/src/impaktapps-ui-builder/builder/build/buildUiSchema.ts +14 -10
- package/src/impaktapps-ui-builder/builder/build/uischema/buildPropertiesSection.ts +1 -1
- package/src/impaktapps-ui-builder/builder/elements/UiSchema/Component/schema.ts +4 -4
- package/src/impaktapps-ui-builder/builder/elements/UiSchema/Component/uiSchema.ts +48 -14
- package/src/impaktapps-ui-builder/builder/elements/UiSchema/PageMaster/uiSchema.ts +21 -14
- package/src/impaktapps-ui-builder/builder/elements/UiSchema/event/schema.ts +3 -0
- package/src/impaktapps-ui-builder/builder/elements/UiSchema/event/uiSchema.ts +13 -31
- package/src/impaktapps-ui-builder/builder/services/component.ts +127 -11
- package/src/impaktapps-ui-builder/builder/services/event.ts +159 -58
- package/src/impaktapps-ui-builder/runtime/services/events.ts +8 -1
- package/src/impaktapps-ui-builder/runtime/services/service.ts +14 -110
|
@@ -44,6 +44,7 @@ const sectionLabels = {
|
|
|
44
44
|
|
|
45
45
|
export function refreshPage (type: string, store: any) {
|
|
46
46
|
const UiSchema = _.cloneDeep(componentBasicUiSchema(store.theme.myTheme))
|
|
47
|
+
const currentConfig = JSON.parse(sessionStorage.getItem("pageFormdata"));
|
|
47
48
|
if (type) {
|
|
48
49
|
const sectionUiSchema = {
|
|
49
50
|
Core: CoreSection,
|
|
@@ -58,18 +59,87 @@ export function refreshPage (type: string, store: any) {
|
|
|
58
59
|
UiSchema.elements[0].config.main.tabLabels = sectionLabels[type] || ["Core", "Style", "Events", "Validation"];
|
|
59
60
|
UiSchema.elements[0].elements = elements || [CoreSection, StyleSection, EventSection(store.theme.myTheme), ValidationSection];
|
|
60
61
|
}
|
|
61
|
-
|
|
62
|
+
|
|
63
|
+
// Get Widget Type of parent
|
|
62
64
|
const path = store.searchParams?.get("path");
|
|
63
|
-
const
|
|
65
|
+
const lastDotIndex = path.lastIndexOf('.')
|
|
66
|
+
const parentPath = path.slice(0,lastDotIndex)
|
|
67
|
+
|
|
68
|
+
const parentObj = _.get(currentConfig, parentPath)
|
|
64
69
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
70
|
+
if(parentObj?.type === "Table"){
|
|
71
|
+
UiSchema.elements[0].elements[0].elements[4] =
|
|
72
|
+
{
|
|
73
|
+
type: "Control",
|
|
74
|
+
scope: "#/properties/columnFormat",
|
|
75
|
+
options: {
|
|
76
|
+
widget: "SelectInputField",
|
|
77
|
+
},
|
|
78
|
+
config: {
|
|
79
|
+
layout: { xs: 6, sm: 6, md: 4, lg: 3 },
|
|
80
|
+
main: {
|
|
81
|
+
label: "Column Format",
|
|
82
|
+
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
};
|
|
86
|
+
UiSchema.elements[0].elements[0].elements[6] =
|
|
87
|
+
{
|
|
88
|
+
type: "Control",
|
|
89
|
+
scope: "#/properties/filteringOptions",
|
|
90
|
+
options: {
|
|
91
|
+
widget: "SelectInputField",
|
|
92
|
+
},
|
|
93
|
+
config: {
|
|
94
|
+
layout: { xs: 6, sm: 6, md: 4, lg: 3 },
|
|
95
|
+
main: {
|
|
96
|
+
label: "Filter Mode",
|
|
97
|
+
multiple: true
|
|
98
|
+
},
|
|
99
|
+
},
|
|
100
|
+
};
|
|
101
|
+
UiSchema.elements[0].elements[0].elements[5] =
|
|
102
|
+
{
|
|
103
|
+
type: "Control",
|
|
104
|
+
scope: "#/properties/enableFilter",
|
|
105
|
+
options: {
|
|
106
|
+
widget: "RadioInputField",
|
|
107
|
+
},
|
|
108
|
+
config: {
|
|
109
|
+
layout: { xs: 6, sm: 6, md: 4, lg: 3 },
|
|
110
|
+
main: {
|
|
111
|
+
label: "Enable Filter",
|
|
112
|
+
options: ["Yes", "No"],
|
|
113
|
+
},
|
|
114
|
+
},
|
|
115
|
+
},
|
|
116
|
+
UiSchema.elements[0].elements[0].elements[7] =
|
|
117
|
+
{
|
|
118
|
+
type: "Control",
|
|
119
|
+
scope: "#/properties/enableSorting",
|
|
120
|
+
options: {
|
|
121
|
+
widget: "RadioInputField",
|
|
122
|
+
},
|
|
123
|
+
config: {
|
|
124
|
+
layout: { xs: 6, sm: 6, md: 4, lg: 3 },
|
|
125
|
+
main: {
|
|
126
|
+
label: "Enable Sorting",
|
|
127
|
+
options: ["Yes", "No"],
|
|
128
|
+
},
|
|
129
|
+
},
|
|
130
|
+
},
|
|
131
|
+
UiSchema.elements[0].elements[0].elements[8] =
|
|
132
|
+
{
|
|
133
|
+
type: "Control",
|
|
134
|
+
scope: "#/properties/proc",
|
|
135
|
+
config: {
|
|
136
|
+
layout: { xs: 6, sm: 6, md: 8, lg: 3 },
|
|
137
|
+
},
|
|
138
|
+
options: {
|
|
139
|
+
widget: "EmptyBox",
|
|
140
|
+
},
|
|
141
|
+
};
|
|
142
|
+
}
|
|
73
143
|
|
|
74
144
|
if (sessionStorage.getItem("copiedConfig") ) {
|
|
75
145
|
this.ElementPathSetter(UiSchema);
|
|
@@ -97,6 +167,35 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
|
|
|
97
167
|
if (sessionStorage.getItem("copiedConfig") ) {
|
|
98
168
|
schema.properties.RemoveItemButton.disabled = false;
|
|
99
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
|
+
|
|
189
|
+
arr.map((e) => {
|
|
190
|
+
const data = _.get(config, e)
|
|
191
|
+
pathArray.push({
|
|
192
|
+
label: data?.name || data?.eventType || "NewComponent",
|
|
193
|
+
path: `/Component?path=${e}${id ? `&id=${id}` : ''}`
|
|
194
|
+
});
|
|
195
|
+
})
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
schema.properties.pageName.path = pathArray
|
|
100
199
|
return schema;
|
|
101
200
|
},
|
|
102
201
|
okHandler: () => okHandler(store),
|
|
@@ -207,6 +306,10 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
|
|
|
207
306
|
|
|
208
307
|
this.ElementPathSetter(uiSchema,copiedFormData);
|
|
209
308
|
sessionStorage.setItem('copiedConfig',JSON.stringify(copiedFormData));
|
|
309
|
+
store.setNotify({
|
|
310
|
+
SuccessMessage: `${elementType} Copied Successfully`,
|
|
311
|
+
Success: true,
|
|
312
|
+
})
|
|
210
313
|
store.setSchema(schema);
|
|
211
314
|
store.setUiSchema(uiSchema);
|
|
212
315
|
},
|
|
@@ -269,7 +372,20 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
|
|
|
269
372
|
},
|
|
270
373
|
ElementPathSetter: function(uiSchema: any,copiedFormData?: any){
|
|
271
374
|
const formData = copiedFormData || JSON.parse(sessionStorage.getItem("copiedConfig"));
|
|
272
|
-
uiSchema
|
|
375
|
+
if(uiSchema?.elements?.[1]?.elements?.[0]?.config?.main?.headerIcons){
|
|
376
|
+
uiSchema.elements[1].elements[0].config.main.headerIcons.elements[1].widget.config.main.tooltipMessage = `Copied Component: ${formData.name}`;
|
|
377
|
+
}
|
|
378
|
+
else if(uiSchema?.elements?.[0]?.elements?.[1]?.elements?.[0]?.config?.main?.headerIcons){
|
|
379
|
+
uiSchema.elements[0].elements[1].elements[0].config.main.headerIcons.elements[1].widget.config.main.tooltipMessage = `Copied Component: ${formData.name}`;
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
|
|
383
|
+
if(uiSchema?.elements?.[1]?.elements?.[1]?.config?.main?.headerIcons){
|
|
384
|
+
uiSchema.elements[1].elements[1].config.main.headerIcons.elements[1].widget.config.main.tooltipMessage = `Copied Event: ${formData.eventType}`;
|
|
385
|
+
}
|
|
386
|
+
else if(uiSchema?.elements?.[0]?.elements?.[1]?.config?.main?.headerIcons){
|
|
387
|
+
uiSchema.elements[0].elements[1].config.main.headerIcons.elements[1].widget.config.main.tooltipMessage = `Copied Component: ${formData.eventType}`;
|
|
388
|
+
}
|
|
273
389
|
}
|
|
274
390
|
}
|
|
275
391
|
};
|
|
@@ -1,9 +1,19 @@
|
|
|
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
19
|
|
|
@@ -12,95 +22,178 @@ export default (
|
|
|
12
22
|
dynamicData: any,
|
|
13
23
|
submitHandler: any,
|
|
14
24
|
service: any,
|
|
15
|
-
functionsName?: { const: string
|
|
25
|
+
functionsName?: { const: string; title: string }[]
|
|
16
26
|
) => {
|
|
17
27
|
return {
|
|
18
28
|
setPage: async function () {
|
|
19
29
|
const formdata = await this.getFormData();
|
|
20
30
|
store.setFormdata(formdata);
|
|
21
31
|
const schema = await this.getSchema();
|
|
32
|
+
console.log("SettingSchema>>",schema)
|
|
22
33
|
store.setSchema(schema);
|
|
23
|
-
this.refreshPage(formdata.Handler, store)
|
|
34
|
+
this.refreshPage(formdata.Handler, store);
|
|
24
35
|
},
|
|
25
36
|
refreshPage: (handlerType: any, store: any) => {
|
|
26
37
|
const uiSchema = _.cloneDeep(EventUiSchema(store.theme.myTheme));
|
|
27
|
-
const schema: any = _.cloneDeep(EventSchema)
|
|
38
|
+
const schema: any = _.cloneDeep(EventSchema);
|
|
28
39
|
if (handlerType) {
|
|
29
40
|
if (handlerType === "custom") {
|
|
30
|
-
uiSchema.elements[0].elements[0].elements[2] =
|
|
41
|
+
uiSchema.elements[0].elements[0].elements[2] = getRadioInputField(
|
|
42
|
+
"isSync",
|
|
43
|
+
"Run in Sync",
|
|
44
|
+
["Yes", "No"]
|
|
45
|
+
);
|
|
31
46
|
uiSchema.elements[0].elements[0].elements[3] = {
|
|
32
47
|
type: "Control",
|
|
33
48
|
scope: "#/properties/emptyBox",
|
|
34
49
|
options: {
|
|
35
50
|
widget: "EmptyBox",
|
|
36
51
|
},
|
|
37
|
-
|
|
52
|
+
|
|
38
53
|
config: {
|
|
39
54
|
layout: { xs: 6, sm: 6, md: 0, lg: 3 },
|
|
40
55
|
main: {},
|
|
41
|
-
style:{}
|
|
56
|
+
style: {},
|
|
42
57
|
},
|
|
43
58
|
};
|
|
44
|
-
uiSchema.elements[0].elements[0].elements[4] = getTextArea(
|
|
45
|
-
|
|
46
|
-
|
|
59
|
+
uiSchema.elements[0].elements[0].elements[4] = getTextArea(
|
|
60
|
+
"eventCode",
|
|
61
|
+
"Write Custom Code",
|
|
62
|
+
false
|
|
63
|
+
);
|
|
64
|
+
schema.required = ["eventType", "Handler", "eventCode"];
|
|
47
65
|
} else if (handlerType === "api") {
|
|
48
|
-
uiSchema.elements[0].elements[0].elements[2] = emptyBox("emptyBox", {
|
|
66
|
+
uiSchema.elements[0].elements[0].elements[2] = emptyBox("emptyBox", {
|
|
67
|
+
xs: 0,
|
|
68
|
+
sm: 0,
|
|
69
|
+
md: 4,
|
|
70
|
+
lg: 6,
|
|
71
|
+
});
|
|
49
72
|
uiSchema.elements[0].elements[0].elements[3] = APISection;
|
|
50
|
-
schema.required = ["eventType", "Handler", "method", "path"]
|
|
73
|
+
schema.required = ["eventType", "Handler", "method", "path"];
|
|
51
74
|
} else if (handlerType === "inBuiltFunction") {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
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
|
+
);
|
|
58
84
|
uiSchema.elements[0].elements[0].elements[3] = {
|
|
59
85
|
type: "Control",
|
|
60
86
|
scope: "#/properties/emptyBox",
|
|
61
87
|
options: {
|
|
62
88
|
widget: "EmptyBox",
|
|
63
89
|
},
|
|
64
|
-
|
|
90
|
+
|
|
65
91
|
config: {
|
|
66
92
|
layout: { xs: 6, sm: 6, md: 0, lg: 3 },
|
|
67
93
|
main: {},
|
|
68
|
-
style:{}
|
|
94
|
+
style: {},
|
|
69
95
|
},
|
|
70
96
|
};
|
|
71
|
-
uiSchema.elements[0].elements[0].elements[4] = getTextArea(
|
|
72
|
-
|
|
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"];
|
|
73
103
|
} else if (handlerType === "refresh") {
|
|
74
|
-
uiSchema.elements[0].elements[0].elements[2] = emptyBox("emptyBox", {
|
|
104
|
+
uiSchema.elements[0].elements[0].elements[2] = emptyBox("emptyBox", {
|
|
105
|
+
xs: 0,
|
|
106
|
+
sm: 0,
|
|
107
|
+
md: 4,
|
|
108
|
+
lg: 6,
|
|
109
|
+
});
|
|
75
110
|
uiSchema.elements[0].elements[0].elements[3] = refreshSectionUiSchema;
|
|
76
|
-
schema.properties.refreshElements.required = ["value"]
|
|
77
|
-
schema.properties.refreshElements.items.required = ["value"]
|
|
78
|
-
schema.required = ["eventType", "Handler", "refreshElements"]
|
|
111
|
+
schema.properties.refreshElements.required = ["value"];
|
|
112
|
+
schema.properties.refreshElements.items.required = ["value"];
|
|
113
|
+
schema.required = ["eventType", "Handler", "refreshElements"];
|
|
79
114
|
}
|
|
80
115
|
}
|
|
81
116
|
if (functionsName) {
|
|
82
117
|
schema.properties.inBuiltFunctionType.oneOf = [
|
|
83
118
|
...schema.properties.inBuiltFunctionType.oneOf,
|
|
84
|
-
...functionsName
|
|
85
|
-
]
|
|
119
|
+
...functionsName,
|
|
120
|
+
];
|
|
86
121
|
}
|
|
87
|
-
if (sessionStorage.getItem("copiedConfig")
|
|
88
|
-
Component(store, dynamicData, submitHandler, service).ElementPathSetter(
|
|
122
|
+
if (sessionStorage.getItem("copiedConfig")) {
|
|
123
|
+
Component(store, dynamicData, submitHandler, service).ElementPathSetter(
|
|
124
|
+
uiSchema
|
|
125
|
+
);
|
|
89
126
|
schema.properties.RemoveItemButton.disabled = false;
|
|
90
127
|
}
|
|
91
|
-
|
|
92
|
-
|
|
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);
|
|
93
158
|
},
|
|
94
159
|
|
|
95
|
-
getFormData: Component(store, dynamicData, submitHandler, service)
|
|
160
|
+
getFormData: Component(store, dynamicData, submitHandler, service)
|
|
161
|
+
.getFormdata,
|
|
96
162
|
getUiSchema: function () {
|
|
97
163
|
return EventUiSchema;
|
|
98
164
|
},
|
|
99
165
|
getSchema: () => {
|
|
100
166
|
const schema = _.cloneDeep(EventSchema);
|
|
101
|
-
if (sessionStorage.getItem("copiedConfig")
|
|
167
|
+
if (sessionStorage.getItem("copiedConfig")) {
|
|
102
168
|
schema.properties.RemoveItemButton.disabled = false;
|
|
103
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);
|
|
104
197
|
return schema;
|
|
105
198
|
},
|
|
106
199
|
okHandler: () => okHandler(store),
|
|
@@ -110,48 +203,56 @@ export default (
|
|
|
110
203
|
store?.formData?.Handler !== store?.newData?.Handler &&
|
|
111
204
|
store?.newData?.Handler !== undefined
|
|
112
205
|
) {
|
|
113
|
-
this.refreshPage(
|
|
206
|
+
this.refreshPage(
|
|
207
|
+
store.newData.Handler || store.formdata.Handler,
|
|
208
|
+
store
|
|
209
|
+
);
|
|
114
210
|
}
|
|
115
211
|
},
|
|
116
212
|
addEvent: function () {
|
|
117
213
|
const path = store.searchParams?.get("path");
|
|
118
214
|
if (!Array.isArray(store.formData.events)) {
|
|
119
|
-
store.formData.events = []
|
|
215
|
+
store.formData.events = [];
|
|
120
216
|
}
|
|
121
|
-
saveFormdataInSessionStorage(store.ctx.core.data, path)
|
|
122
|
-
const finalPath = `${path}.events[${store.formData?.events?.length}]
|
|
123
|
-
store.searchParams.set("path", finalPath)
|
|
124
|
-
store.setSearchParams(store.searchParams)
|
|
125
|
-
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();
|
|
126
222
|
},
|
|
127
223
|
editEvent: function () {
|
|
128
224
|
const rowId = dynamicData.path.split(".")[1];
|
|
129
225
|
const path = store.searchParams?.get("path");
|
|
130
|
-
saveFormdataInSessionStorage(store.ctx.core.data, path)
|
|
131
|
-
const finalPath = `${path}.events[${rowId}]
|
|
132
|
-
store.searchParams.set("path", finalPath)
|
|
133
|
-
store.setSearchParams(store.searchParams)
|
|
134
|
-
this.setPage()
|
|
135
|
-
|
|
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();
|
|
136
231
|
},
|
|
137
232
|
deleteEvent: async function () {
|
|
138
|
-
await Component(store, dynamicData, submitHandler, service).deleteEvent(
|
|
233
|
+
await Component(store, dynamicData, submitHandler, service).deleteEvent(
|
|
234
|
+
false
|
|
235
|
+
);
|
|
139
236
|
store.updateDialog("popUpEvent");
|
|
140
237
|
},
|
|
141
238
|
backHandler: function () {
|
|
142
|
-
store.navigate(-1)
|
|
239
|
+
store.navigate(-1);
|
|
143
240
|
},
|
|
144
|
-
deletePopUpEvent: function(){
|
|
241
|
+
deletePopUpEvent: function () {
|
|
145
242
|
const rowId = dynamicData.path.split(".")[1];
|
|
146
|
-
sessionStorage.setItem(
|
|
243
|
+
sessionStorage.setItem("rowId", rowId);
|
|
147
244
|
store.updateDialog("popUpEvent");
|
|
148
245
|
},
|
|
149
|
-
copyPasteElement:
|
|
150
|
-
Component(store, dynamicData, submitHandler, service).copyPasteElement(
|
|
246
|
+
copyPasteElement: function () {
|
|
247
|
+
Component(store, dynamicData, submitHandler, service).copyPasteElement(
|
|
248
|
+
store,
|
|
249
|
+
this.setPage.bind(this)
|
|
250
|
+
);
|
|
151
251
|
},
|
|
152
|
-
RemoveItemButton: function(){
|
|
153
|
-
Component(store, dynamicData, submitHandler, service).RemoveItemButton(
|
|
252
|
+
RemoveItemButton: function () {
|
|
253
|
+
Component(store, dynamicData, submitHandler, service).RemoveItemButton(
|
|
254
|
+
store
|
|
255
|
+
);
|
|
154
256
|
},
|
|
155
|
-
|
|
156
|
-
}
|
|
257
|
+
};
|
|
157
258
|
};
|
|
@@ -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 = [];
|
|
@@ -186,6 +186,13 @@ function mergeFormdata(handlerResponse: any, componentName: string, eventConfig:
|
|
|
186
186
|
store.setFormdata((pre: any) => { return { ...pre, ...handlerResponse?.data } })
|
|
187
187
|
}
|
|
188
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
|
+
}
|
|
189
196
|
else {
|
|
190
197
|
if (handlerResponse) {
|
|
191
198
|
formDataHolder[componentName] = handlerResponse.data
|
|
@@ -89,119 +89,22 @@ export default (funcParams: funcParamsProps) => {
|
|
|
89
89
|
}))
|
|
90
90
|
}
|
|
91
91
|
const config = pageData?.config;
|
|
92
|
+
|
|
93
|
+
const pathParts = funcParams.store.location.pathname.split("/");
|
|
94
|
+
const programId = JSON.parse(window.sessionStorage.getItem("ProgramID") || "{}")?.value || "programID";
|
|
95
|
+
if (pathParts?.[1] === "page") {
|
|
96
|
+
if(programId !== "programID"){
|
|
97
|
+
funcParams.store.setFormdata((pre) => ({ ...pre, programId: programId }));
|
|
98
|
+
}
|
|
99
|
+
}
|
|
92
100
|
const uiSchema = pageData?.uiSchema;
|
|
101
|
+
|
|
93
102
|
const event = new CustomEvent('pageNameChanged', {
|
|
94
103
|
detail: { pageName: config.label }
|
|
95
104
|
});
|
|
96
105
|
window.dispatchEvent(event)
|
|
97
106
|
const theme = funcParams?.store?.theme?.myTheme;
|
|
98
107
|
uiSchema.elements.push(
|
|
99
|
-
|
|
100
|
-
// {
|
|
101
|
-
// type: "HorizontalLayout",
|
|
102
|
-
// config: {
|
|
103
|
-
// main: {
|
|
104
|
-
// direction: "row",
|
|
105
|
-
// },
|
|
106
|
-
// style: {
|
|
107
|
-
// flexDirection: "row",
|
|
108
|
-
// position: "absolute",
|
|
109
|
-
// bottom: 0,
|
|
110
|
-
// height: "fit-content",
|
|
111
|
-
// overflow: "hidden",
|
|
112
|
-
// zIndex: 1000,
|
|
113
|
-
// width: "inherit",
|
|
114
|
-
// },
|
|
115
|
-
// },
|
|
116
|
-
// elements: [
|
|
117
|
-
// {
|
|
118
|
-
// type: "Control",
|
|
119
|
-
// scope: "#/properties/FooterText",
|
|
120
|
-
// options: {
|
|
121
|
-
// widget: "Box",
|
|
122
|
-
// },
|
|
123
|
-
// config: {
|
|
124
|
-
// main: {
|
|
125
|
-
// heading: "Copywriter@ACT21.IO",
|
|
126
|
-
// },
|
|
127
|
-
// style: {
|
|
128
|
-
// color: theme?.palette?.text?.disabled || "#AFAFAF",
|
|
129
|
-
// fontSize: "12px",
|
|
130
|
-
// textAlign: "center",
|
|
131
|
-
// lineHeight: 2,
|
|
132
|
-
// width: "fit-content",
|
|
133
|
-
// left: "50%",
|
|
134
|
-
// position: "relative",
|
|
135
|
-
// margin: 0,
|
|
136
|
-
// flexGrow: 1,
|
|
137
|
-
// height: 0,
|
|
138
|
-
// transform: "translate(-50%, 0%)",
|
|
139
|
-
// },
|
|
140
|
-
// },
|
|
141
|
-
// },
|
|
142
|
-
// {
|
|
143
|
-
// type: "Control",
|
|
144
|
-
// scope: "#/properties/FooterBackIcon",
|
|
145
|
-
// options: {
|
|
146
|
-
// widget: "Box",
|
|
147
|
-
// },
|
|
148
|
-
// config: {
|
|
149
|
-
// main: {
|
|
150
|
-
// iconName: "PrevIcon",
|
|
151
|
-
// onClick: "backHandler",
|
|
152
|
-
// width: "fit-content",
|
|
153
|
-
// },
|
|
154
|
-
// style: {
|
|
155
|
-
// fill: theme?.palette?.primary?.main,
|
|
156
|
-
// width: 20,
|
|
157
|
-
// height: 0,
|
|
158
|
-
// // margin: 0,
|
|
159
|
-
// top: 0,
|
|
160
|
-
// right: { xs: "12px", sm: "84px" },
|
|
161
|
-
// position: "absolute",
|
|
162
|
-
// fontSize: "12px",
|
|
163
|
-
// cursor: "pointer",
|
|
164
|
-
// ":hover": {
|
|
165
|
-
// fill: theme?.palette?.primary?.dark,
|
|
166
|
-
// },
|
|
167
|
-
// marginRight: "13px",
|
|
168
|
-
// },
|
|
169
|
-
// },
|
|
170
|
-
// },
|
|
171
|
-
// {
|
|
172
|
-
// type: "Control",
|
|
173
|
-
// scope: "#/properties/FooterBackHandlerText",
|
|
174
|
-
// options: {
|
|
175
|
-
// widget: "Box",
|
|
176
|
-
// },
|
|
177
|
-
// config: {
|
|
178
|
-
// main: {
|
|
179
|
-
// heading: "Previous Page",
|
|
180
|
-
// onClick: "backHandler",
|
|
181
|
-
// },
|
|
182
|
-
// style: {
|
|
183
|
-
// display: { xs: "none", sm: "flex" },
|
|
184
|
-
// textAlign: "left",
|
|
185
|
-
// lineHeight: 1,
|
|
186
|
-
// height: 0,
|
|
187
|
-
// width: "fit-content",
|
|
188
|
-
// color: theme?.palette?.primary?.main,
|
|
189
|
-
// fontSize: "14px",
|
|
190
|
-
// cursor: "pointer",
|
|
191
|
-
// marginLeft: "2px",
|
|
192
|
-
|
|
193
|
-
// top: 3,
|
|
194
|
-
// right: "12px",
|
|
195
|
-
// position: "absolute",
|
|
196
|
-
// ":hover": {
|
|
197
|
-
// color: theme?.palette?.primary?.dark,
|
|
198
|
-
// },
|
|
199
|
-
// marginRight: "4px",
|
|
200
|
-
// },
|
|
201
|
-
// },
|
|
202
|
-
// },
|
|
203
|
-
// ],
|
|
204
|
-
// }
|
|
205
108
|
{
|
|
206
109
|
type: "HorizontalLayout",
|
|
207
110
|
config: {
|
|
@@ -294,7 +197,7 @@ export default (funcParams: funcParamsProps) => {
|
|
|
294
197
|
fontSize: "12px",
|
|
295
198
|
cursor: "pointer",
|
|
296
199
|
marginLeft: "2px",
|
|
297
|
-
|
|
200
|
+
|
|
298
201
|
top: 3,
|
|
299
202
|
right: "12px",
|
|
300
203
|
position: "absolute",
|
|
@@ -319,12 +222,12 @@ export default (funcParams: funcParamsProps) => {
|
|
|
319
222
|
await executeRefreshHandler({
|
|
320
223
|
config: {}, componentName: "",
|
|
321
224
|
store: funcParams.store, dynamicData: funcParams.dynamicData, userValue: funcParams.userValue, service: funcParams.service,
|
|
322
|
-
serviceHolder: this, eventGroups, formDataHolder
|
|
225
|
+
serviceHolder: this, eventGroups, formDataHolder: {}
|
|
323
226
|
})
|
|
324
227
|
funcParams.store.setSchema(
|
|
325
228
|
(pre: any) => {
|
|
326
229
|
return {
|
|
327
|
-
...schema
|
|
230
|
+
...schema, ...pre, properties:
|
|
328
231
|
{ ...schema.properties, ...pre.properties, }
|
|
329
232
|
}
|
|
330
233
|
}
|
|
@@ -336,7 +239,8 @@ export default (funcParams: funcParamsProps) => {
|
|
|
336
239
|
if (eventGroups.onCellRenderer) {
|
|
337
240
|
let finalResponse = {};
|
|
338
241
|
const path = funcParams.dynamicData?.tableButtonPath || funcParams?.dynamicData?.path?.split(".")[0];
|
|
339
|
-
|
|
242
|
+
|
|
243
|
+
for (const eventConfig of eventGroups?.onCellRenderer?.[path]) {
|
|
340
244
|
executeEventsParameters.store.functionParameters = cellParams
|
|
341
245
|
finalResponse = executeEvents({
|
|
342
246
|
...executeEventsParameters,
|