impaktapps-ui-builder 0.0.101-alpha.9 → 0.0.101-alpha.91
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 +1134 -809
- 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/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/coreSection.d.ts +98 -95
- 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/tableSection.d.ts +29 -33
- package/dist/src/impaktapps-ui-builder/builder/build/uischema/validationSections.d.ts +56 -37
- 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/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/apiSection.ts +111 -96
- package/src/impaktapps-ui-builder/builder/build/uischema/buildPropertiesSection.ts +101 -95
- package/src/impaktapps-ui-builder/builder/build/uischema/coreSection.ts +189 -110
- 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/tableSection.ts +40 -18
- package/src/impaktapps-ui-builder/builder/build/uischema/validationSections.ts +117 -48
- package/src/impaktapps-ui-builder/builder/build/uischema/valueTab.ts +113 -45
- package/src/impaktapps-ui-builder/builder/elements/UiSchema/Component/schema.ts +23 -23
- package/src/impaktapps-ui-builder/builder/elements/UiSchema/Component/uiSchema.ts +119 -51
- package/src/impaktapps-ui-builder/builder/elements/UiSchema/PageMaster/uiSchema.ts +30 -21
- package/src/impaktapps-ui-builder/builder/elements/UiSchema/event/schema.ts +15 -12
- package/src/impaktapps-ui-builder/builder/elements/UiSchema/event/uiSchema.ts +188 -295
- package/src/impaktapps-ui-builder/builder/services/component.ts +146 -32
- package/src/impaktapps-ui-builder/builder/services/event.ts +167 -65
- package/src/impaktapps-ui-builder/runtime/services/events.ts +8 -1
- package/src/impaktapps-ui-builder/runtime/services/service.ts +5 -4
|
@@ -10,54 +10,137 @@ import { ValueTab } from "../build/uischema/valueTab";
|
|
|
10
10
|
import { ValidationSection } from "../build/uischema/validationSections";
|
|
11
11
|
import { getFormdataFromSessionStorage, okHandler, saveFormdataInSessionStorage, saveHandler } from "./utils";
|
|
12
12
|
const sectionLabels = {
|
|
13
|
-
Select: ["Core", "Properties", "Value", "
|
|
14
|
-
MultipleSelect: ["Core", "Properties", "Value", "
|
|
15
|
-
Table: ["Core", "Components", "Properties", "
|
|
16
|
-
LeaderBoard: ["Core", "Components", "Properties", "
|
|
13
|
+
Select: ["Core", "Properties", "Value", "Events", "Style", "Validation"],
|
|
14
|
+
MultipleSelect: ["Core", "Properties", "Value", "Events", "Style", "Validation"],
|
|
15
|
+
Table: ["Core", "Components", "Properties", "Events", "Style", "Validation"],
|
|
16
|
+
LeaderBoard: ["Core", "Components", "Properties", "Events", "Style", "Validation"],
|
|
17
17
|
WrapperSection: ["Core", "Components", "Properties", "Style", "Validation"],
|
|
18
18
|
TabSection: ["Core", "Components", "Properties", "Style", "Validation"],
|
|
19
|
-
SpeedoMeter: ["Core", "Properties", "
|
|
20
|
-
card: ["Core", "Properties", "
|
|
21
|
-
UploadFile: ["Core", "
|
|
22
|
-
Graph: ["Core", "Properties", "
|
|
23
|
-
DownloadFile: ["Core", "
|
|
24
|
-
Box: ["Core", "
|
|
25
|
-
Properties: ["Core", "Properties", "
|
|
26
|
-
ProgressBarCard: ["Core", "Properties", "
|
|
27
|
-
RankCard: ["Core", "Properties", "
|
|
28
|
-
Slider: ["Core", "Components", "
|
|
29
|
-
Timer: ["Core", "
|
|
30
|
-
Rank: ["Core", "
|
|
31
|
-
Button: ["Core", "Properties", "
|
|
19
|
+
SpeedoMeter: ["Core", "Properties", "Events", "Style", "Validation"],
|
|
20
|
+
card: ["Core", "Properties", "Events", "Style", "Validation"],
|
|
21
|
+
UploadFile: ["Core", "Events", "Style", "Validation"],
|
|
22
|
+
Graph: ["Core", "Properties", "Events", "Style", "Validation"],
|
|
23
|
+
DownloadFile: ["Core", "Events", "Style", "Validation"],
|
|
24
|
+
Box: ["Core", "Events", "Style", "Validation"],
|
|
25
|
+
Properties: ["Core", "Properties", "Events", "Style", "Validation"],
|
|
26
|
+
ProgressBarCard: ["Core", "Properties", "Events", "Style", "Validation"],
|
|
27
|
+
RankCard: ["Core", "Properties", "Events", "Style", "Validation"],
|
|
28
|
+
Slider: ["Core", "Components", "Events", "Style", "Validation"],
|
|
29
|
+
Timer: ["Core", "Events", "Style", "Validation"],
|
|
30
|
+
Rank: ["Core", "Events", "Style", "Validation"],
|
|
31
|
+
Button: ["Core", "Properties", "Events", "Style", "Validation"],
|
|
32
32
|
Array: ["Core", "Components", "Validation"],
|
|
33
|
-
Radio: ["Core", "Properties", "
|
|
34
|
-
Text: ["Core", "Properties", "
|
|
35
|
-
TextArea: ["Core", "Properties", "
|
|
33
|
+
Radio: ["Core", "Properties", "Events", "Style", "Validation"],
|
|
34
|
+
Text: ["Core", "Properties", "Events", "Style", "Validation"],
|
|
35
|
+
TextArea: ["Core", "Properties", "Events", "Style", "Validation"],
|
|
36
36
|
PopUp: ["Core", "Components", "Properties", "Style"],
|
|
37
|
-
Stepper: ["Core", "Components", "Properties", "
|
|
38
|
-
DataGrid: ["Core", "Components", "Properties", "
|
|
39
|
-
InputSlider: ["Core", "Properties", "
|
|
40
|
-
TreeMap: ["Core", "Components", "Properties", "
|
|
37
|
+
Stepper: ["Core", "Components", "Properties", "Events", "Style"],
|
|
38
|
+
DataGrid: ["Core", "Components", "Properties", "Events", "Style"],
|
|
39
|
+
InputSlider: ["Core", "Properties", "Events", "Style", "Validation"],
|
|
40
|
+
TreeMap: ["Core", "Components", "Properties", "Events", "Style"],
|
|
41
41
|
ColumnGroup: ["Core", "Components"],
|
|
42
|
-
Thought: ["Core", "Properties", "
|
|
42
|
+
Thought: ["Core", "Properties", "Events", "Style", "Validation"]
|
|
43
43
|
}
|
|
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,
|
|
50
51
|
Value: ValueTab,
|
|
51
52
|
Style: StyleSection,
|
|
52
|
-
|
|
53
|
+
Events: EventSection(store.theme.myTheme),
|
|
53
54
|
Components: TableSection(store.theme.myTheme),
|
|
54
55
|
Properties: buildPropertiesSection(type),
|
|
55
56
|
Validation: ValidationSection
|
|
56
57
|
}
|
|
57
58
|
const elements = sectionLabels[type]?.map(e => sectionUiSchema[e]);
|
|
58
|
-
UiSchema.elements[0].config.main.tabLabels = sectionLabels[type] || ["Core", "Style", "
|
|
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
|
}
|
|
62
|
+
|
|
63
|
+
// Get Widget Type of parent
|
|
64
|
+
const path = store.searchParams?.get("path");
|
|
65
|
+
const lastDotIndex = path.lastIndexOf('.')
|
|
66
|
+
const parentPath = path.slice(0,lastDotIndex)
|
|
67
|
+
|
|
68
|
+
const parentObj = _.get(currentConfig, parentPath)
|
|
69
|
+
|
|
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
|
+
}
|
|
143
|
+
|
|
61
144
|
if (sessionStorage.getItem("copiedConfig") ) {
|
|
62
145
|
this.ElementPathSetter(UiSchema);
|
|
63
146
|
}
|
|
@@ -84,6 +167,35 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
|
|
|
84
167
|
if (sessionStorage.getItem("copiedConfig") ) {
|
|
85
168
|
schema.properties.RemoveItemButton.disabled = false;
|
|
86
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
|
|
87
199
|
return schema;
|
|
88
200
|
},
|
|
89
201
|
okHandler: () => okHandler(store),
|
|
@@ -219,16 +331,16 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
|
|
|
219
331
|
|
|
220
332
|
const copiedConfig = JSON.parse(sessionStorage.getItem("copiedConfig"));
|
|
221
333
|
const notificationMessages = {
|
|
222
|
-
|
|
223
|
-
Component: "The component cannot be integrated into the
|
|
334
|
+
Events: " The Events cannot be integrated into the component section.",
|
|
335
|
+
Component: "The component cannot be integrated into the Events section."
|
|
224
336
|
};
|
|
225
337
|
if(copiedConfig.Handler && elementType === "Component"){
|
|
226
338
|
store.setNotify({
|
|
227
|
-
FailMessage: notificationMessages.
|
|
339
|
+
FailMessage: notificationMessages.Events,
|
|
228
340
|
Fail: true,
|
|
229
341
|
});
|
|
230
342
|
}
|
|
231
|
-
else if(copiedConfig.name && elementType === "
|
|
343
|
+
else if(copiedConfig.name && elementType === "Events"){
|
|
232
344
|
store.setNotify({
|
|
233
345
|
FailMessage: notificationMessages.Component,
|
|
234
346
|
Fail: true,
|
|
@@ -256,7 +368,9 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
|
|
|
256
368
|
},
|
|
257
369
|
ElementPathSetter: function(uiSchema: any,copiedFormData?: any){
|
|
258
370
|
const formData = copiedFormData || JSON.parse(sessionStorage.getItem("copiedConfig"));
|
|
259
|
-
uiSchema
|
|
371
|
+
if(uiSchema?.elements?.[1]?.elements?.[0]?.config?.main?.headerIcons){
|
|
372
|
+
uiSchema.elements[1].elements[0].config.main.headerIcons.elements[1].widget.config.main.tooltipMessage = `Copied Path: ${formData.name}`;
|
|
373
|
+
}
|
|
260
374
|
}
|
|
261
375
|
}
|
|
262
376
|
};
|
|
@@ -1,107 +1,201 @@
|
|
|
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
|
+
console.log("pathArray>>",pathArray)
|
|
156
|
+
schema.properties.pageName.path = pathArray;
|
|
157
|
+
store.setSchema(schema);
|
|
158
|
+
store.setUiSchema(uiSchema);
|
|
94
159
|
},
|
|
95
160
|
|
|
96
|
-
getFormData: Component(store, dynamicData, submitHandler, service)
|
|
161
|
+
getFormData: Component(store, dynamicData, submitHandler, service)
|
|
162
|
+
.getFormdata,
|
|
97
163
|
getUiSchema: function () {
|
|
98
164
|
return EventUiSchema;
|
|
99
165
|
},
|
|
100
166
|
getSchema: () => {
|
|
101
167
|
const schema = _.cloneDeep(EventSchema);
|
|
102
|
-
if (sessionStorage.getItem("copiedConfig")
|
|
168
|
+
if (sessionStorage.getItem("copiedConfig")) {
|
|
103
169
|
schema.properties.RemoveItemButton.disabled = false;
|
|
104
170
|
}
|
|
171
|
+
|
|
172
|
+
const config = JSON.parse(sessionStorage.getItem("pageFormdata"));
|
|
173
|
+
const path = store.searchParams?.get("path");
|
|
174
|
+
const id = store.searchParams?.get("id");
|
|
175
|
+
|
|
176
|
+
let pathArray = [{label: config.name ?? "NewPage", path: `/PageMaster${id ? `?id=${id}` : ''}`}];
|
|
177
|
+
|
|
178
|
+
if (path) {
|
|
179
|
+
const pathArrayAll = path.split(".");
|
|
180
|
+
const arr: any = [];
|
|
181
|
+
pathArrayAll.map((e: string, i: number) => {
|
|
182
|
+
if (i === 0) {
|
|
183
|
+
arr.push(e);
|
|
184
|
+
return;
|
|
185
|
+
}
|
|
186
|
+
arr.push(`${arr[i - 1]}.${e}`);
|
|
187
|
+
});
|
|
188
|
+
|
|
189
|
+
arr.map((e) => {
|
|
190
|
+
const data = _.get(config, e);
|
|
191
|
+
pathArray.push({
|
|
192
|
+
label: data?.name || data?.eventType || "NewComponent",
|
|
193
|
+
path: data?.eventType ? `/ComponentEvents?path=${e}${id ? `&id=${id}` : ''}` : `/Component?path=${e}${id ? `&id=${id}` : ''}`,
|
|
194
|
+
});
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
console.log("pathArray>>",pathArray)
|
|
198
|
+
schema.properties.pageName.path = _.cloneDeep(pathArray);
|
|
105
199
|
return schema;
|
|
106
200
|
},
|
|
107
201
|
okHandler: () => okHandler(store),
|
|
@@ -111,48 +205,56 @@ export default (
|
|
|
111
205
|
store?.formData?.Handler !== store?.newData?.Handler &&
|
|
112
206
|
store?.newData?.Handler !== undefined
|
|
113
207
|
) {
|
|
114
|
-
this.refreshPage(
|
|
208
|
+
this.refreshPage(
|
|
209
|
+
store.newData.Handler || store.formdata.Handler,
|
|
210
|
+
store
|
|
211
|
+
);
|
|
115
212
|
}
|
|
116
213
|
},
|
|
117
214
|
addEvent: function () {
|
|
118
215
|
const path = store.searchParams?.get("path");
|
|
119
216
|
if (!Array.isArray(store.formData.events)) {
|
|
120
|
-
store.formData.events = []
|
|
217
|
+
store.formData.events = [];
|
|
121
218
|
}
|
|
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()
|
|
219
|
+
saveFormdataInSessionStorage(store.ctx.core.data, path);
|
|
220
|
+
const finalPath = `${path}.events[${store.formData?.events?.length}]`;
|
|
221
|
+
store.searchParams.set("path", finalPath);
|
|
222
|
+
store.setSearchParams(store.searchParams);
|
|
223
|
+
this.setPage();
|
|
127
224
|
},
|
|
128
225
|
editEvent: function () {
|
|
129
226
|
const rowId = dynamicData.path.split(".")[1];
|
|
130
227
|
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
|
-
|
|
228
|
+
saveFormdataInSessionStorage(store.ctx.core.data, path);
|
|
229
|
+
const finalPath = `${path}.events[${rowId}]`;
|
|
230
|
+
store.searchParams.set("path", finalPath);
|
|
231
|
+
store.setSearchParams(store.searchParams);
|
|
232
|
+
this.setPage();
|
|
137
233
|
},
|
|
138
234
|
deleteEvent: async function () {
|
|
139
|
-
await Component(store, dynamicData, submitHandler, service).deleteEvent(
|
|
235
|
+
await Component(store, dynamicData, submitHandler, service).deleteEvent(
|
|
236
|
+
false
|
|
237
|
+
);
|
|
140
238
|
store.updateDialog("popUpEvent");
|
|
141
239
|
},
|
|
142
240
|
backHandler: function () {
|
|
143
|
-
store.navigate(-1)
|
|
241
|
+
store.navigate(-1);
|
|
144
242
|
},
|
|
145
|
-
deletePopUpEvent: function(){
|
|
243
|
+
deletePopUpEvent: function () {
|
|
146
244
|
const rowId = dynamicData.path.split(".")[1];
|
|
147
|
-
sessionStorage.setItem(
|
|
245
|
+
sessionStorage.setItem("rowId", rowId);
|
|
148
246
|
store.updateDialog("popUpEvent");
|
|
149
247
|
},
|
|
150
|
-
copyPasteElement:
|
|
151
|
-
Component(store, dynamicData, submitHandler, service).copyPasteElement(
|
|
248
|
+
copyPasteElement: function () {
|
|
249
|
+
Component(store, dynamicData, submitHandler, service).copyPasteElement(
|
|
250
|
+
store,
|
|
251
|
+
this.setPage.bind(this)
|
|
252
|
+
);
|
|
152
253
|
},
|
|
153
|
-
RemoveItemButton: function(){
|
|
154
|
-
Component(store, dynamicData, submitHandler, service).RemoveItemButton(
|
|
254
|
+
RemoveItemButton: function () {
|
|
255
|
+
Component(store, dynamicData, submitHandler, service).RemoveItemButton(
|
|
256
|
+
store
|
|
257
|
+
);
|
|
155
258
|
},
|
|
156
|
-
|
|
157
|
-
}
|
|
259
|
+
};
|
|
158
260
|
};
|
|
@@ -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
|
|
@@ -294,7 +294,7 @@ export default (funcParams: funcParamsProps) => {
|
|
|
294
294
|
fontSize: "12px",
|
|
295
295
|
cursor: "pointer",
|
|
296
296
|
marginLeft: "2px",
|
|
297
|
-
|
|
297
|
+
|
|
298
298
|
top: 3,
|
|
299
299
|
right: "12px",
|
|
300
300
|
position: "absolute",
|
|
@@ -319,12 +319,12 @@ export default (funcParams: funcParamsProps) => {
|
|
|
319
319
|
await executeRefreshHandler({
|
|
320
320
|
config: {}, componentName: "",
|
|
321
321
|
store: funcParams.store, dynamicData: funcParams.dynamicData, userValue: funcParams.userValue, service: funcParams.service,
|
|
322
|
-
serviceHolder: this, eventGroups, formDataHolder
|
|
322
|
+
serviceHolder: this, eventGroups, formDataHolder: {}
|
|
323
323
|
})
|
|
324
324
|
funcParams.store.setSchema(
|
|
325
325
|
(pre: any) => {
|
|
326
326
|
return {
|
|
327
|
-
...schema
|
|
327
|
+
...schema, ...pre, properties:
|
|
328
328
|
{ ...schema.properties, ...pre.properties, }
|
|
329
329
|
}
|
|
330
330
|
}
|
|
@@ -336,7 +336,8 @@ export default (funcParams: funcParamsProps) => {
|
|
|
336
336
|
if (eventGroups.onCellRenderer) {
|
|
337
337
|
let finalResponse = {};
|
|
338
338
|
const path = funcParams.dynamicData?.tableButtonPath || funcParams?.dynamicData?.path?.split(".")[0];
|
|
339
|
-
|
|
339
|
+
|
|
340
|
+
for (const eventConfig of eventGroups?.onCellRenderer?.[path]) {
|
|
340
341
|
executeEventsParameters.store.functionParameters = cellParams
|
|
341
342
|
finalResponse = executeEvents({
|
|
342
343
|
...executeEventsParameters,
|