impaktapps-ui-builder 0.0.382457 → 0.0.382460
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 +4233 -2669
- 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/buildBasicUiSchema.d.ts +4 -1
- package/dist/src/impaktapps-ui-builder/builder/build/buildCard.d.ts +1 -1
- package/dist/src/impaktapps-ui-builder/builder/build/buildConfig.d.ts +1 -1
- package/dist/src/impaktapps-ui-builder/builder/build/buildDate.d.ts +1 -0
- package/dist/src/impaktapps-ui-builder/builder/build/buildInputSlider.d.ts +1 -0
- package/dist/src/impaktapps-ui-builder/builder/build/buildTable.d.ts +0 -1
- package/dist/src/impaktapps-ui-builder/builder/build/buildThoughtOfTheDay.d.ts +1 -0
- package/dist/src/impaktapps-ui-builder/builder/build/buildTreeMap.d.ts +1 -0
- package/dist/src/impaktapps-ui-builder/builder/build/buildUiSchema.d.ts +1 -1
- package/dist/src/impaktapps-ui-builder/builder/build/uischema/apiSection.d.ts +36 -2
- package/dist/src/impaktapps-ui-builder/builder/build/uischema/box.d.ts +2 -2
- package/dist/src/impaktapps-ui-builder/builder/build/uischema/buildPropertiesSection.d.ts +60 -0
- package/dist/src/impaktapps-ui-builder/builder/build/uischema/button.d.ts +1 -7
- package/dist/src/impaktapps-ui-builder/builder/build/uischema/card.d.ts +172 -86
- package/dist/src/impaktapps-ui-builder/builder/build/uischema/coreSection.d.ts +15 -0
- package/dist/src/impaktapps-ui-builder/builder/build/uischema/dateInputField.d.ts +19 -0
- package/dist/src/impaktapps-ui-builder/builder/build/uischema/eventSection.d.ts +121 -119
- package/dist/src/impaktapps-ui-builder/builder/build/uischema/file.d.ts +6 -6
- package/dist/src/impaktapps-ui-builder/builder/build/uischema/graph.d.ts +42 -115
- package/dist/src/impaktapps-ui-builder/builder/build/uischema/leaderBoard.d.ts +10 -288
- package/dist/src/impaktapps-ui-builder/builder/build/uischema/progressBar.d.ts +6 -1
- package/dist/src/impaktapps-ui-builder/builder/build/uischema/table.d.ts +2 -0
- package/dist/src/impaktapps-ui-builder/builder/build/uischema/tableSection.d.ts +119 -96
- package/dist/src/impaktapps-ui-builder/builder/build/uischema/{lazyLoadingTable.d.ts → thoughtOfTheDay.d.ts} +6 -3
- package/dist/src/impaktapps-ui-builder/builder/build/uischema/timer.d.ts +1 -14
- package/dist/src/impaktapps-ui-builder/builder/build/uischema/validationSections.d.ts +17 -2
- package/dist/src/impaktapps-ui-builder/builder/build/uischema/valueTab.d.ts +17 -2
- package/dist/src/impaktapps-ui-builder/builder/build/uischema/wrapperSection.d.ts +2 -1
- package/dist/src/impaktapps-ui-builder/builder/elements/UiSchema/PageMaster/schema.d.ts +9 -0
- package/dist/src/impaktapps-ui-builder/builder/elements/UiSchema/event/schema.d.ts +3 -0
- package/dist/src/impaktapps-ui-builder/builder/services/component.d.ts +12 -4
- package/dist/src/impaktapps-ui-builder/builder/services/event.d.ts +11 -2
- package/dist/src/impaktapps-ui-builder/builder/services/pageMaster.d.ts +16 -3
- package/dist/src/impaktapps-ui-builder/builder/services/utils.d.ts +4 -4
- package/dist/src/impaktapps-ui-builder/lib/index.d.ts +1 -1
- package/dist/src/impaktapps-ui-builder/runtime/services/events.d.ts +8 -5
- package/dist/src/impaktapps-ui-builder/runtime/services/interface.d.ts +2 -0
- package/dist/src/impaktapps-ui-builder/runtime/services/service.d.ts +11 -8
- package/package.json +5 -1
- package/src/impaktapps-ui-builder/builder/build/buildBasicUiSchema.ts +9 -5
- package/src/impaktapps-ui-builder/builder/build/buildButton.ts +0 -2
- package/src/impaktapps-ui-builder/builder/build/buildCard.ts +11 -7
- package/src/impaktapps-ui-builder/builder/build/buildConfig.ts +15 -19
- package/src/impaktapps-ui-builder/builder/build/buildDate.ts +12 -2
- package/src/impaktapps-ui-builder/builder/build/buildFileInput.ts +1 -1
- package/src/impaktapps-ui-builder/builder/build/buildHorizontalBarGraph.ts +22 -9
- package/src/impaktapps-ui-builder/builder/build/buildInputSlider.ts +46 -0
- package/src/impaktapps-ui-builder/builder/build/buildLeaderboard.ts +26 -19
- package/src/impaktapps-ui-builder/builder/build/buildLineGraph.ts +16 -2
- package/src/impaktapps-ui-builder/builder/build/buildPieGraph.ts +24 -23
- package/src/impaktapps-ui-builder/builder/build/buildProgressBar.ts +1 -1
- package/src/impaktapps-ui-builder/builder/build/buildRadio.ts +1 -1
- package/src/impaktapps-ui-builder/builder/build/buildRankCard.ts +4 -10
- package/src/impaktapps-ui-builder/builder/build/buildSchema.ts +1 -2
- package/src/impaktapps-ui-builder/builder/build/buildStackBarGraph.ts +19 -8
- package/src/impaktapps-ui-builder/builder/build/buildTabSection.ts +9 -2
- package/src/impaktapps-ui-builder/builder/build/buildTable.ts +39 -29
- package/src/impaktapps-ui-builder/builder/build/buildTextArea.ts +6 -0
- package/src/impaktapps-ui-builder/builder/build/buildThoughtOfTheDay.ts +22 -0
- package/src/impaktapps-ui-builder/builder/build/buildTreeMap.ts +61 -0
- package/src/impaktapps-ui-builder/builder/build/buildUiSchema.ts +77 -57
- package/src/impaktapps-ui-builder/builder/build/buildUplaodFile.ts +16 -19
- package/src/impaktapps-ui-builder/builder/build/buildWrapperSection.ts +16 -13
- package/src/impaktapps-ui-builder/builder/build/uischema/apiSection.ts +50 -27
- package/src/impaktapps-ui-builder/builder/build/uischema/box.ts +3 -2
- package/src/impaktapps-ui-builder/builder/build/uischema/buildPropertiesSection.ts +174 -80
- package/src/impaktapps-ui-builder/builder/build/uischema/button.ts +1 -7
- package/src/impaktapps-ui-builder/builder/build/uischema/card.ts +171 -75
- package/src/impaktapps-ui-builder/builder/build/uischema/coreSection.ts +43 -41
- package/src/impaktapps-ui-builder/builder/build/uischema/dateInputField.ts +17 -7
- package/src/impaktapps-ui-builder/builder/build/uischema/emptyBox.ts +1 -1
- package/src/impaktapps-ui-builder/builder/build/uischema/eventSection.ts +78 -56
- package/src/impaktapps-ui-builder/builder/build/uischema/file.ts +2 -12
- package/src/impaktapps-ui-builder/builder/build/uischema/graph.ts +13 -141
- package/src/impaktapps-ui-builder/builder/build/uischema/leaderBoard.ts +10 -357
- package/src/impaktapps-ui-builder/builder/build/uischema/multiSelect.ts +1 -1
- package/src/impaktapps-ui-builder/builder/build/uischema/progressBar.ts +1 -1
- package/src/impaktapps-ui-builder/builder/build/uischema/rankCard.ts +1 -1
- package/src/impaktapps-ui-builder/builder/build/uischema/refresh.ts +15 -11
- package/src/impaktapps-ui-builder/builder/build/uischema/runnerBoyProgressBar.ts +1 -1
- package/src/impaktapps-ui-builder/builder/build/uischema/selectInputField.ts +1 -6
- package/src/impaktapps-ui-builder/builder/build/uischema/table.ts +5 -6
- package/src/impaktapps-ui-builder/builder/build/uischema/tableSection.ts +125 -97
- package/src/impaktapps-ui-builder/builder/build/uischema/textInputField.ts +1 -6
- package/src/impaktapps-ui-builder/builder/build/uischema/thoughtOfTheDay.ts +14 -0
- package/src/impaktapps-ui-builder/builder/build/uischema/timer.ts +2 -16
- package/src/impaktapps-ui-builder/builder/build/uischema/validationSections.ts +12 -12
- package/src/impaktapps-ui-builder/builder/build/uischema/valueTab.ts +13 -13
- package/src/impaktapps-ui-builder/builder/build/uischema/wrapperSection.ts +2 -1
- package/src/impaktapps-ui-builder/builder/elements/UiSchema/Component/schema.ts +67 -19
- package/src/impaktapps-ui-builder/builder/elements/UiSchema/Component/uiSchema.ts +525 -166
- package/src/impaktapps-ui-builder/builder/elements/UiSchema/PageMaster/schema.ts +12 -2
- package/src/impaktapps-ui-builder/builder/elements/UiSchema/PageMaster/uiSchema.ts +757 -321
- package/src/impaktapps-ui-builder/builder/elements/UiSchema/event/schema.ts +7 -2
- package/src/impaktapps-ui-builder/builder/elements/UiSchema/event/uiSchema.ts +516 -269
- package/src/impaktapps-ui-builder/builder/services/component.ts +165 -73
- package/src/impaktapps-ui-builder/builder/services/event.ts +74 -13
- package/src/impaktapps-ui-builder/builder/services/pageMaster.ts +61 -20
- package/src/impaktapps-ui-builder/builder/services/utils.ts +13 -14
- package/src/impaktapps-ui-builder/lib/index.ts +1 -1
- package/src/impaktapps-ui-builder/runtime/services/downloadFile.ts +1 -1
- package/src/impaktapps-ui-builder/runtime/services/events.ts +154 -96
- package/src/impaktapps-ui-builder/runtime/services/interface.ts +3 -1
- package/src/impaktapps-ui-builder/runtime/services/service.ts +211 -49
- package/src/impaktapps-ui-builder/builder/build/uischema/lazyLoadingTable.ts +0 -14
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import _ from "lodash";
|
|
2
|
-
import { ComponentSchema } from "../elements/UiSchema/Component/schema";
|
|
1
|
+
import _, { cloneDeep } from "lodash";
|
|
2
|
+
import { ComponentSchema } from "../elements/UiSchema/Component/schema";
|
|
3
3
|
import { componentBasicUiSchema } from "../elements/UiSchema/Component/uiSchema";
|
|
4
4
|
import { CoreSection } from "../build/uischema/coreSection";
|
|
5
5
|
import { EventSection } from "../build/uischema/eventSection";
|
|
@@ -8,57 +8,60 @@ import { StyleSection } from "../build/uischema/styleSection";
|
|
|
8
8
|
import { TableSection } from "../build/uischema/tableSection";
|
|
9
9
|
import { ValueTab } from "../build/uischema/valueTab";
|
|
10
10
|
import { ValidationSection } from "../build/uischema/validationSections";
|
|
11
|
-
import {
|
|
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",
|
|
16
|
-
LeaderBoard: ["Core", "Components", "Properties", "
|
|
17
|
-
WrapperSection: ["Core", "Components","Properties", "
|
|
18
|
-
TabSection: ["Core", "Components", "Properties", "
|
|
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", "
|
|
32
|
-
Array:["Core","Components","Validation"],
|
|
33
|
-
Radio:["Core", "Properties", "
|
|
34
|
-
Text:["Core","Properties","
|
|
35
|
-
TextArea:["Core","Properties","
|
|
36
|
-
PopUp: ["Core", "Components","Properties", "
|
|
37
|
-
Stepper: ["Core", "Components","Properties","Event", "
|
|
38
|
-
DataGrid: ["Core", "Components","Properties","Event", "
|
|
13
|
+
Select: ["Core", "Properties", "Value", "Event", "Style", "Validation"],
|
|
14
|
+
MultipleSelect: ["Core", "Properties", "Value", "Event", "Style", "Validation"],
|
|
15
|
+
Table: ["Core", "Components", "Properties", "Event", "Style", "Validation"],
|
|
16
|
+
LeaderBoard: ["Core", "Components", "Properties", "Event", "Style", "Validation"],
|
|
17
|
+
WrapperSection: ["Core", "Components", "Properties", "Style", "Validation"],
|
|
18
|
+
TabSection: ["Core", "Components", "Properties", "Style", "Validation"],
|
|
19
|
+
SpeedoMeter: ["Core", "Properties", "Event", "Style", "Validation"],
|
|
20
|
+
card: ["Core", "Properties", "Event", "Style", "Validation"],
|
|
21
|
+
UploadFile: ["Core", "Event", "Style", "Validation"],
|
|
22
|
+
Graph: ["Core", "Properties", "Event", "Style", "Validation"],
|
|
23
|
+
DownloadFile: ["Core", "Event", "Style", "Validation"],
|
|
24
|
+
Box: ["Core", "Event", "Style", "Validation"],
|
|
25
|
+
Properties: ["Core", "Properties", "Event", "Style", "Validation"],
|
|
26
|
+
ProgressBarCard: ["Core", "Properties", "Event", "Style", "Validation"],
|
|
27
|
+
RankCard: ["Core", "Properties", "Event", "Style", "Validation"],
|
|
28
|
+
Slider: ["Core", "Components", "Event", "Style", "Validation"],
|
|
29
|
+
Timer: ["Core", "Event", "Style", "Validation"],
|
|
30
|
+
Rank: ["Core", "Event", "Style", "Validation"],
|
|
31
|
+
Button: ["Core", "Properties", "Event", "Style", "Validation"],
|
|
32
|
+
Array: ["Core", "Components", "Validation"],
|
|
33
|
+
Radio: ["Core", "Properties", "Event", "Style", "Validation"],
|
|
34
|
+
Text: ["Core", "Properties", "Event", "Style", "Validation"],
|
|
35
|
+
TextArea: ["Core", "Properties", "Event", "Style", "Validation"],
|
|
36
|
+
PopUp: ["Core", "Components", "Properties", "Style"],
|
|
37
|
+
Stepper: ["Core", "Components", "Properties", "Event", "Style"],
|
|
38
|
+
DataGrid: ["Core", "Components", "Properties", "Event", "Style"],
|
|
39
|
+
InputSlider: ["Core", "Properties", "Event", "Style", "Validation"],
|
|
40
|
+
TreeMap: ["Core", "Components", "Properties", "Event", "Style"],
|
|
41
|
+
ColumnGroup: ["Core", "Components"],
|
|
42
|
+
Thought: ["Core", "Properties", "Event", "Style", "Validation"]
|
|
39
43
|
}
|
|
40
44
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
45
|
+
export function refreshPage (type: string, store: any) {
|
|
46
|
+
const UiSchema = _.cloneDeep(componentBasicUiSchema(store.theme.myTheme))
|
|
47
|
+
if (type) {
|
|
48
|
+
const sectionUiSchema = {
|
|
49
|
+
Core: CoreSection,
|
|
50
|
+
Value: ValueTab,
|
|
51
|
+
Style: StyleSection,
|
|
52
|
+
Event: EventSection(store.theme.myTheme),
|
|
53
|
+
Components: TableSection(store.theme.myTheme),
|
|
54
|
+
Properties: buildPropertiesSection(type),
|
|
55
|
+
Validation: ValidationSection
|
|
56
|
+
}
|
|
57
|
+
const elements = sectionLabels[type]?.map(e => sectionUiSchema[e]);
|
|
58
|
+
UiSchema.elements[1].config.main.tabLabels = sectionLabels[type] || ["Core", "Style", "Event", "Validation"];
|
|
59
|
+
UiSchema.elements[1].elements = elements || [CoreSection, StyleSection, EventSection(store.theme.myTheme), ValidationSection];
|
|
55
60
|
}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
}
|
|
61
|
-
store.setUiSchema(UiSchema);
|
|
61
|
+
if (sessionStorage.getItem("copiedConfig") ) {
|
|
62
|
+
this.ElementPathSetter(UiSchema);
|
|
63
|
+
}
|
|
64
|
+
store.setUiSchema(UiSchema);
|
|
62
65
|
}
|
|
63
66
|
|
|
64
67
|
export default (store: any, dynamicData: any, submitHandler: any, service: any) => {
|
|
@@ -67,33 +70,37 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
|
|
|
67
70
|
const formdata = await this.getFormdata();
|
|
68
71
|
store.setFormdata(formdata);
|
|
69
72
|
const schema = this.getSchema();
|
|
70
|
-
store.setSchema(schema);
|
|
71
|
-
|
|
72
|
-
|
|
73
|
+
store.setSchema(schema);
|
|
74
|
+
this.refreshPage(formdata?.type, store);
|
|
75
|
+
|
|
73
76
|
},
|
|
74
|
-
refreshPage:refreshPage,
|
|
77
|
+
refreshPage: refreshPage,
|
|
75
78
|
getFormdata: function () {
|
|
76
79
|
const path = store.searchParams?.get("path");
|
|
77
|
-
return
|
|
80
|
+
return getFormdataFromSessionStorage(path)
|
|
78
81
|
},
|
|
79
82
|
getSchema: function () {
|
|
80
|
-
|
|
83
|
+
const schema = _.cloneDeep(ComponentSchema);
|
|
84
|
+
if (sessionStorage.getItem("copiedConfig") ) {
|
|
85
|
+
schema.properties.RemoveItemButton.disabled = false;
|
|
86
|
+
}
|
|
87
|
+
return schema;
|
|
81
88
|
},
|
|
82
|
-
okHandler:()=>okHandler(store),
|
|
83
|
-
saveHandler: async ()=> await saveHandler(store,service,submitHandler,"PageMaster"),
|
|
89
|
+
okHandler: () => okHandler(store),
|
|
90
|
+
saveHandler: async () => await saveHandler(store, service, submitHandler, "PageMaster"),
|
|
84
91
|
onChange: function () {
|
|
85
92
|
if (
|
|
86
93
|
store?.formData?.type !== store?.newData?.type &&
|
|
87
94
|
store?.newData?.type !== undefined
|
|
88
95
|
) {
|
|
89
|
-
this.refreshPage(store?.newData?.type,store);
|
|
96
|
+
this.refreshPage(store?.newData?.type, store);
|
|
90
97
|
}
|
|
91
98
|
},
|
|
92
99
|
editComponents: function () {
|
|
93
100
|
const rowId = dynamicData.path.split(".")[1];
|
|
94
101
|
const path = store.searchParams?.get("path");
|
|
95
102
|
const id = store.searchParams?.get("id");
|
|
96
|
-
|
|
103
|
+
saveFormdataInSessionStorage(store.ctx.core.data, path)
|
|
97
104
|
if (path) {
|
|
98
105
|
const path = store.searchParams?.get("path");
|
|
99
106
|
const finalPath = `${path}.elements[${rowId}]`
|
|
@@ -104,27 +111,35 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
|
|
|
104
111
|
store.navigate(`/Component?path=${`elements[${rowId}]`}&id=${id}`)
|
|
105
112
|
}
|
|
106
113
|
},
|
|
107
|
-
deleteComponents: function () {
|
|
114
|
+
deleteComponents: function (shouldUpdateDialog: boolean = true) {
|
|
108
115
|
const path = store.searchParams?.get("path");
|
|
109
|
-
const rowId =
|
|
116
|
+
const rowId = sessionStorage.getItem('rowId');
|
|
110
117
|
store.formData.elements.splice(rowId, 1);
|
|
111
|
-
const response =
|
|
118
|
+
const response = saveFormdataInSessionStorage(store.ctx.core.data, path)
|
|
112
119
|
const data = path ? _.get(response, path) : response;
|
|
113
120
|
store.setFormdata(data);
|
|
121
|
+
if (shouldUpdateDialog) {
|
|
122
|
+
store.updateDialog("popUpComponentSection");
|
|
123
|
+
}
|
|
124
|
+
sessionStorage.removeItem('rowId');
|
|
114
125
|
},
|
|
115
|
-
deleteEvent: function () {
|
|
126
|
+
deleteEvent: function (shouldUpdateDialog: boolean = true) {
|
|
116
127
|
const path = store.searchParams?.get("path");
|
|
117
|
-
const rowId =
|
|
128
|
+
const rowId = sessionStorage.getItem('rowId');
|
|
118
129
|
store.formData.events.splice(rowId, 1);
|
|
119
|
-
const response =
|
|
130
|
+
const response = saveFormdataInSessionStorage(store.ctx.core.data, path)
|
|
120
131
|
store.setFormdata(_.get(response, path));
|
|
132
|
+
if (shouldUpdateDialog) {
|
|
133
|
+
store.updateDialog("popUpEventSection")
|
|
134
|
+
}
|
|
135
|
+
sessionStorage.removeItem('rowId');
|
|
121
136
|
},
|
|
122
137
|
widgetAddClickHandler: function () {
|
|
123
138
|
if (!Array.isArray(store.formData.elements)) {
|
|
124
139
|
store.formData.elements = []
|
|
125
140
|
}
|
|
126
141
|
const path = store.searchParams?.get("path");
|
|
127
|
-
|
|
142
|
+
saveFormdataInSessionStorage(store.ctx.core.data, path)
|
|
128
143
|
const finalPath = `${path}.elements[${store.formData.elements.length}]`
|
|
129
144
|
store.searchParams.set("path", finalPath)
|
|
130
145
|
store.setSearchParams(store.searchParams)
|
|
@@ -135,7 +150,7 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
|
|
|
135
150
|
const rowId = dynamicData.path.split(".")[1];
|
|
136
151
|
const path = store.searchParams?.get("path");
|
|
137
152
|
const id = store.searchParams?.get("id");
|
|
138
|
-
|
|
153
|
+
saveFormdataInSessionStorage(store.ctx.core.data, path)
|
|
139
154
|
const finalPath = `${path}.events[${rowId}]`
|
|
140
155
|
store.navigate(`/ComponentEvents?path=${finalPath}&id=${id}`)
|
|
141
156
|
},
|
|
@@ -145,19 +160,96 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
|
|
|
145
160
|
if (!Array.isArray(store.formData.events)) {
|
|
146
161
|
store.formData.events = []
|
|
147
162
|
}
|
|
148
|
-
|
|
163
|
+
saveFormdataInSessionStorage(store.ctx.core.data, path)
|
|
149
164
|
const finalPath = `${path}.events[${store.formData.events.length}]`
|
|
150
165
|
store.navigate(`/ComponentEvents?path=${finalPath}&id=${id}`)
|
|
151
166
|
},
|
|
152
167
|
backHandler: function () {
|
|
153
168
|
store.navigate(-1)
|
|
154
169
|
},
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
170
|
+
deletePopUpComponent: function () {
|
|
171
|
+
const rowId = dynamicData.path.split(".")[1];
|
|
172
|
+
sessionStorage.setItem('rowId',rowId);
|
|
173
|
+
store.updateDialog("popUpComponentSection");
|
|
174
|
+
},
|
|
175
|
+
deletePopUpEvent: function () {
|
|
176
|
+
const rowId = dynamicData.path.split(".")[1];
|
|
177
|
+
sessionStorage.setItem('rowId',rowId);
|
|
178
|
+
store.updateDialog("popUpEventSection");
|
|
179
|
+
},
|
|
160
180
|
|
|
181
|
+
copyPasteElement: function(paramStore: any, setPage: any = this.setPage.bind(this) ){
|
|
182
|
+
const [actionType, elementType] = dynamicData.path.split('.').pop()?.split('_');
|
|
183
|
+
actionType === "Copy" ? this.CopyElement(paramStore, elementType) : this.PasteElement(setPage, elementType);
|
|
184
|
+
},
|
|
185
|
+
CopyElement: function(paramStore: any = store, elementType: string){
|
|
186
|
+
const schema = cloneDeep(paramStore.schema );
|
|
187
|
+
const uiSchema = cloneDeep(paramStore.uiSchema );
|
|
188
|
+
schema.properties.RemoveItemButton.disabled = false;
|
|
161
189
|
|
|
190
|
+
const rowId = dynamicData.path.split(".")[1];
|
|
191
|
+
const parentPathOfCopiedComponent = store.searchParams?.get("path");
|
|
192
|
+
const copiedElementPath = this.elementPathHandler(parentPathOfCopiedComponent, rowId, elementType);
|
|
193
|
+
const copiedFormData = getFormdataFromSessionStorage(copiedElementPath);
|
|
162
194
|
|
|
195
|
+
this.ElementPathSetter(uiSchema,copiedFormData);
|
|
196
|
+
sessionStorage.setItem('copiedConfig',JSON.stringify(copiedFormData));
|
|
197
|
+
store.setSchema(schema);
|
|
198
|
+
store.setUiSchema(uiSchema);
|
|
199
|
+
},
|
|
200
|
+
PasteElement: function( setPage: any , elementType: string){
|
|
201
|
+
if (!sessionStorage.getItem("copiedConfig") ) {
|
|
202
|
+
store.setNotify({
|
|
203
|
+
FailMessage: "No item has been copied.",
|
|
204
|
+
Fail: true,
|
|
205
|
+
});
|
|
206
|
+
return;
|
|
207
|
+
}
|
|
208
|
+
const pastedElementParentPath = store.searchParams?.get("path");
|
|
209
|
+
const formData = getFormdataFromSessionStorage(pastedElementParentPath);
|
|
210
|
+
const insertElementIndex = elementType === "Component" ? formData.elements.length : formData.events.length;
|
|
211
|
+
const pastedElementPath = this.elementPathHandler(pastedElementParentPath, insertElementIndex, elementType);
|
|
163
212
|
|
|
213
|
+
const copiedConfig = JSON.parse(sessionStorage.getItem("copiedConfig"));
|
|
214
|
+
const notificationMessages = {
|
|
215
|
+
Event: " The event cannot be integrated into the component section.",
|
|
216
|
+
Component: "The component cannot be integrated into the event section."
|
|
217
|
+
};
|
|
218
|
+
if(copiedConfig.Handler && elementType === "Component"){
|
|
219
|
+
store.setNotify({
|
|
220
|
+
FailMessage: notificationMessages.Event,
|
|
221
|
+
Fail: true,
|
|
222
|
+
});
|
|
223
|
+
}
|
|
224
|
+
else if(copiedConfig.name && elementType === "Event"){
|
|
225
|
+
store.setNotify({
|
|
226
|
+
FailMessage: notificationMessages.Component,
|
|
227
|
+
Fail: true,
|
|
228
|
+
});
|
|
229
|
+
}
|
|
230
|
+
else{
|
|
231
|
+
saveFormdataInSessionStorage(copiedConfig, pastedElementPath);
|
|
232
|
+
setPage();
|
|
233
|
+
}
|
|
234
|
+
},
|
|
235
|
+
RemoveItemButton: function(paramStore: any = store){
|
|
236
|
+
const schema = cloneDeep(paramStore.schema );
|
|
237
|
+
const uiSchema = cloneDeep(paramStore.uiSchema);
|
|
238
|
+
schema.properties.RemoveItemButton.disabled = true;
|
|
239
|
+
uiSchema.elements[2].elements[1].config.main.heading = `No element copied`;
|
|
240
|
+
sessionStorage.removeItem('copiedConfig');
|
|
241
|
+
store.setSchema(schema);
|
|
242
|
+
store.setUiSchema(uiSchema);
|
|
243
|
+
},
|
|
244
|
+
elementPathHandler: function(parentPath: string, rowId: any, elementType: string){
|
|
245
|
+
if(elementType === "Component"){
|
|
246
|
+
return parentPath ? `${parentPath}.elements[${rowId}]` : `elements[${rowId}]`;
|
|
247
|
+
}
|
|
248
|
+
return parentPath ? `${parentPath}.events[${rowId}]` : `events[${rowId}]`;
|
|
249
|
+
},
|
|
250
|
+
ElementPathSetter: function(uiSchema: any,copiedFormData?: any){
|
|
251
|
+
const formData = copiedFormData || JSON.parse(sessionStorage.getItem("copiedConfig"));
|
|
252
|
+
uiSchema.elements[2].elements[1].config.main.heading = `Copied Path: ${formData.pageName}`;
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
};
|
|
@@ -1,17 +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 { okHandler,
|
|
4
|
+
import { okHandler, saveFormdataInSessionStorage, saveHandler, getFormdataFromSessionStorage } from "./utils";
|
|
5
5
|
import { APISection } from "../build/uischema/apiSection";
|
|
6
|
-
import { getSelectField, getTextArea } from "../build/uischema/buildPropertiesSection";
|
|
6
|
+
import { getRadioInputField, getSelectField, getTextArea } from "../build/uischema/buildPropertiesSection";
|
|
7
7
|
import { refreshSectionUiSchema } from "../build/uischema/refresh";
|
|
8
8
|
import _ from "lodash";
|
|
9
|
+
import emptyBox from "../build/uischema/emptyBox";
|
|
9
10
|
|
|
10
11
|
export default (
|
|
11
12
|
store: any,
|
|
12
13
|
dynamicData: any,
|
|
13
14
|
submitHandler: any,
|
|
14
|
-
service: any
|
|
15
|
+
service: any,
|
|
16
|
+
functionsName?: { const: string, title: string }[]
|
|
15
17
|
) => {
|
|
16
18
|
return {
|
|
17
19
|
setPage: async function () {
|
|
@@ -22,31 +24,71 @@ export default (
|
|
|
22
24
|
this.refreshPage(formdata.Handler, store)
|
|
23
25
|
},
|
|
24
26
|
refreshPage: (handlerType: any, store: any) => {
|
|
25
|
-
const uiSchema = _.cloneDeep(EventUiSchema);
|
|
27
|
+
const uiSchema = _.cloneDeep(EventUiSchema(store.theme.myTheme));
|
|
26
28
|
const schema: any = _.cloneDeep(EventSchema)
|
|
27
29
|
if (handlerType) {
|
|
28
30
|
if (handlerType === "custom") {
|
|
29
|
-
uiSchema.elements[1].elements[0].elements[2] =
|
|
31
|
+
uiSchema.elements[1].elements[0].elements[2] = getRadioInputField("isSync","Run in Sync",["Yes","No"])
|
|
32
|
+
uiSchema.elements[1].elements[0].elements[3] = {
|
|
33
|
+
type: "Control",
|
|
34
|
+
scope: "#/properties/emptyBox",
|
|
35
|
+
options: {
|
|
36
|
+
widget: "EmptyBox",
|
|
37
|
+
},
|
|
38
|
+
|
|
39
|
+
config: {
|
|
40
|
+
layout: { xs: 0, sm: 6, md: 0, lg: 0 },
|
|
41
|
+
main: {},
|
|
42
|
+
style:{}
|
|
43
|
+
},
|
|
44
|
+
};
|
|
45
|
+
uiSchema.elements[1].elements[0].elements[4] = getTextArea("eventCode", "Write Custom Code", false)
|
|
30
46
|
schema.required = ["eventType", "Handler", "eventCode"]
|
|
31
47
|
|
|
32
48
|
} else if (handlerType === "api") {
|
|
33
|
-
uiSchema.elements[1].elements[0].elements[2] =
|
|
49
|
+
uiSchema.elements[1].elements[0].elements[2] = emptyBox;
|
|
50
|
+
uiSchema.elements[1].elements[0].elements[3] = APISection;
|
|
34
51
|
schema.required = ["eventType", "Handler", "method", "path"]
|
|
35
52
|
} else if (handlerType === "inBuiltFunction") {
|
|
53
|
+
|
|
36
54
|
uiSchema.elements[1].elements[0].elements[2] = getSelectField("inBuiltFunctionType", "Function Name", [
|
|
37
55
|
{ label: "RankProvider", value: "RankProvider" },
|
|
38
56
|
{ label: "Download File", value: "downloadFile" },
|
|
39
57
|
{ label: "Download Blob File", value: "downloadBlobFile" }
|
|
40
58
|
])
|
|
41
|
-
uiSchema.elements[1].elements[0].elements[3] =
|
|
59
|
+
uiSchema.elements[1].elements[0].elements[3] = {
|
|
60
|
+
type: "Control",
|
|
61
|
+
scope: "#/properties/emptyBox",
|
|
62
|
+
options: {
|
|
63
|
+
widget: "EmptyBox",
|
|
64
|
+
},
|
|
65
|
+
|
|
66
|
+
config: {
|
|
67
|
+
layout: { xs: 6, sm: 6, md: 0, lg: 0 },
|
|
68
|
+
main: {},
|
|
69
|
+
style:{}
|
|
70
|
+
},
|
|
71
|
+
};
|
|
72
|
+
uiSchema.elements[1].elements[0].elements[4] = getTextArea("funcParametersCode", "Write Custom Code for Functions Parameter", true);
|
|
42
73
|
schema.required = ["eventType", "Handler", "inBuiltFunctionType"]
|
|
43
74
|
} else if (handlerType === "refresh") {
|
|
44
|
-
uiSchema.elements[1].elements[0].elements[2] =
|
|
75
|
+
uiSchema.elements[1].elements[0].elements[2] = emptyBox;
|
|
76
|
+
uiSchema.elements[1].elements[0].elements[3] = refreshSectionUiSchema;
|
|
45
77
|
schema.properties.refreshElements.required = ["value"]
|
|
46
78
|
schema.properties.refreshElements.items.required = ["value"]
|
|
47
79
|
schema.required = ["eventType", "Handler", "refreshElements"]
|
|
48
80
|
}
|
|
49
81
|
}
|
|
82
|
+
if (functionsName) {
|
|
83
|
+
schema.properties.inBuiltFunctionType.oneOf = [
|
|
84
|
+
...schema.properties.inBuiltFunctionType.oneOf,
|
|
85
|
+
...functionsName
|
|
86
|
+
]
|
|
87
|
+
}
|
|
88
|
+
if (sessionStorage.getItem("copiedConfig") ) {
|
|
89
|
+
Component(store, dynamicData, submitHandler, service).ElementPathSetter(uiSchema);
|
|
90
|
+
schema.properties.RemoveItemButton.disabled = false;
|
|
91
|
+
}
|
|
50
92
|
store.setSchema(schema)
|
|
51
93
|
store.setUiSchema(uiSchema)
|
|
52
94
|
},
|
|
@@ -56,10 +98,14 @@ export default (
|
|
|
56
98
|
return EventUiSchema;
|
|
57
99
|
},
|
|
58
100
|
getSchema: () => {
|
|
59
|
-
|
|
101
|
+
const schema = _.cloneDeep(EventSchema);
|
|
102
|
+
if (sessionStorage.getItem("copiedConfig") ) {
|
|
103
|
+
schema.properties.RemoveItemButton.disabled = false;
|
|
104
|
+
}
|
|
105
|
+
return schema;
|
|
60
106
|
},
|
|
61
107
|
okHandler: () => okHandler(store),
|
|
62
|
-
saveHandler: async () => await saveHandler(store, service, submitHandler,"PageMaster"),
|
|
108
|
+
saveHandler: async () => await saveHandler(store, service, submitHandler, "PageMaster"),
|
|
63
109
|
onChange: function () {
|
|
64
110
|
if (
|
|
65
111
|
store?.formData?.Handler !== store?.newData?.Handler &&
|
|
@@ -73,7 +119,7 @@ export default (
|
|
|
73
119
|
if (!Array.isArray(store.formData.events)) {
|
|
74
120
|
store.formData.events = []
|
|
75
121
|
}
|
|
76
|
-
|
|
122
|
+
saveFormdataInSessionStorage(store.ctx.core.data, path)
|
|
77
123
|
const finalPath = `${path}.events[${store.formData?.events?.length}]`
|
|
78
124
|
store.searchParams.set("path", finalPath)
|
|
79
125
|
store.setSearchParams(store.searchParams)
|
|
@@ -82,16 +128,31 @@ export default (
|
|
|
82
128
|
editEvent: function () {
|
|
83
129
|
const rowId = dynamicData.path.split(".")[1];
|
|
84
130
|
const path = store.searchParams?.get("path");
|
|
85
|
-
|
|
131
|
+
saveFormdataInSessionStorage(store.ctx.core.data, path)
|
|
86
132
|
const finalPath = `${path}.events[${rowId}]`
|
|
87
133
|
store.searchParams.set("path", finalPath)
|
|
88
134
|
store.setSearchParams(store.searchParams)
|
|
89
135
|
this.setPage()
|
|
90
136
|
|
|
91
137
|
},
|
|
92
|
-
deleteEvent:
|
|
138
|
+
deleteEvent: async function () {
|
|
139
|
+
await Component(store, dynamicData, submitHandler, service).deleteEvent(false);
|
|
140
|
+
store.updateDialog("popUpEvent");
|
|
141
|
+
},
|
|
93
142
|
backHandler: function () {
|
|
94
143
|
store.navigate(-1)
|
|
95
144
|
},
|
|
145
|
+
deletePopUpEvent: function(){
|
|
146
|
+
const rowId = dynamicData.path.split(".")[1];
|
|
147
|
+
sessionStorage.setItem('rowId',rowId);
|
|
148
|
+
store.updateDialog("popUpEvent");
|
|
149
|
+
},
|
|
150
|
+
copyPasteElement: function(){
|
|
151
|
+
Component(store, dynamicData, submitHandler, service).copyPasteElement(store,this.setPage.bind(this));
|
|
152
|
+
},
|
|
153
|
+
RemoveItemButton: function(){
|
|
154
|
+
Component(store, dynamicData, submitHandler, service).RemoveItemButton(store)
|
|
155
|
+
},
|
|
156
|
+
|
|
96
157
|
}
|
|
97
158
|
};
|
|
@@ -2,19 +2,18 @@ import { PageMasterSchema } from "../elements/UiSchema/PageMaster/schema";
|
|
|
2
2
|
import { PageMasterUiSchema } from "../elements/UiSchema/PageMaster/uiSchema";
|
|
3
3
|
import _ from "lodash";
|
|
4
4
|
import Component from "./component";
|
|
5
|
-
import {
|
|
5
|
+
import { getFormdataFromSessionStorage, saveFormdataInSessionStorage, saveHandler } from "./utils";
|
|
6
6
|
|
|
7
7
|
|
|
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
|
-
config?: any
|
|
15
14
|
}
|
|
16
15
|
export default (funcParams: funcParamsProps) => {
|
|
17
|
-
const { store, dynamicData,
|
|
16
|
+
const { store, dynamicData, submitHandler, service } = funcParams
|
|
18
17
|
return {
|
|
19
18
|
setPage: async function () {
|
|
20
19
|
const formdata = await this.getFormdata();
|
|
@@ -24,23 +23,32 @@ export default (funcParams: funcParamsProps) => {
|
|
|
24
23
|
store.setSchema(schema);
|
|
25
24
|
store.setUiSchema(uiSchema);
|
|
26
25
|
},
|
|
27
|
-
getFormdata: function () {
|
|
26
|
+
getFormdata: async function () {
|
|
28
27
|
const id = store.searchParams?.get("id");
|
|
29
|
-
const
|
|
28
|
+
const config: any = await funcParams.pageConfigProvider(id)
|
|
29
|
+
const formData = getFormdataFromSessionStorage()
|
|
30
30
|
if (formData) {
|
|
31
31
|
return formData;
|
|
32
32
|
}
|
|
33
|
-
|
|
33
|
+
saveFormdataInSessionStorage(config)
|
|
34
34
|
return config
|
|
35
35
|
},
|
|
36
36
|
getUiSchema: function () {
|
|
37
|
-
|
|
37
|
+
const UiSchema = _.cloneDeep(PageMasterUiSchema(store.theme.myTheme));
|
|
38
|
+
if (sessionStorage.getItem("copiedConfig") ) {
|
|
39
|
+
Component(store, dynamicData, submitHandler, service).ElementPathSetter(UiSchema)
|
|
40
|
+
}
|
|
41
|
+
return UiSchema;
|
|
38
42
|
},
|
|
39
43
|
getSchema: () => {
|
|
40
|
-
|
|
44
|
+
const schema = _.cloneDeep(PageMasterSchema);
|
|
45
|
+
if (sessionStorage.getItem("copiedConfig") ) {
|
|
46
|
+
schema.properties.RemoveItemButton.disabled = false;
|
|
47
|
+
}
|
|
48
|
+
return schema;
|
|
41
49
|
},
|
|
42
50
|
backHandler: () => {
|
|
43
|
-
|
|
51
|
+
sessionStorage.removeItem("pageFormdata")
|
|
44
52
|
store.navigate("/PageMasterRecords");
|
|
45
53
|
},
|
|
46
54
|
onAddClickHandler: function () {
|
|
@@ -48,35 +56,68 @@ export default (funcParams: funcParamsProps) => {
|
|
|
48
56
|
if (!Array.isArray(store.formData.elements)) {
|
|
49
57
|
store.formData.elements = []
|
|
50
58
|
}
|
|
51
|
-
const response =
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
59
|
+
const response = saveFormdataInSessionStorage(store.ctx.core.data)
|
|
60
|
+
if (id) {
|
|
61
|
+
store.navigate(
|
|
62
|
+
`/Component?path=${`elements[${response?.elements.length}]`}&id=${id}`
|
|
63
|
+
);
|
|
64
|
+
} else {
|
|
65
|
+
store.navigate(
|
|
66
|
+
`/Component?path=${`elements[${response?.elements.length}]`}`
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
|
|
55
70
|
},
|
|
56
|
-
saveHandler: async ()=> await saveHandler(store,service,submitHandler),
|
|
71
|
+
saveHandler: async () => await saveHandler(store, service, submitHandler),
|
|
57
72
|
Edit_Components: Component(store, dynamicData, submitHandler, service).editComponents,
|
|
58
|
-
|
|
73
|
+
|
|
74
|
+
Delete_Components: async function() {
|
|
75
|
+
await Component(store, dynamicData, submitHandler, service).deleteComponents(false);
|
|
76
|
+
store.updateDialog("popUpPageMasterComponent");
|
|
77
|
+
},
|
|
59
78
|
eventAddHandler: function () {
|
|
60
79
|
const id = store.searchParams?.get("id");
|
|
61
80
|
if (!Array.isArray(store.formData.events)) {
|
|
62
81
|
store.formData.events = []
|
|
63
82
|
}
|
|
64
|
-
|
|
83
|
+
saveFormdataInSessionStorage(store.ctx.core.data)
|
|
65
84
|
const finalPath = `events[${store.formData.events.length}]`
|
|
66
85
|
store.navigate(`/ComponentEvents?path=${finalPath}&id=${id}`)
|
|
67
86
|
},
|
|
68
87
|
editEvent: function () {
|
|
69
88
|
const rowId = dynamicData.path.split(".")[1];
|
|
70
89
|
const id = store.searchParams?.get("id");
|
|
71
|
-
|
|
90
|
+
saveFormdataInSessionStorage(store.ctx.core.data)
|
|
72
91
|
const finalPath = `events[${rowId}]`
|
|
73
92
|
store.navigate(`/ComponentEvents?path=${finalPath}&id=${id}`)
|
|
74
93
|
},
|
|
75
94
|
deleteEvent: function () {
|
|
76
|
-
const rowId =
|
|
95
|
+
const rowId = sessionStorage.getItem('rowId');
|
|
77
96
|
store.formData.events.splice(rowId, 1);
|
|
78
|
-
const response =
|
|
97
|
+
const response = saveFormdataInSessionStorage(store.ctx.core.data)
|
|
79
98
|
store.setFormdata(response);
|
|
99
|
+
store.updateDialog("popUpPageMasterEvent");
|
|
100
|
+
sessionStorage.removeItem('rowId');
|
|
101
|
+
},
|
|
102
|
+
deletePopUpComponent: function(){
|
|
103
|
+
const rowId = dynamicData.path.split(".")[1];
|
|
104
|
+
sessionStorage.setItem('rowId',rowId);
|
|
105
|
+
store.updateDialog("popUpPageMasterComponent");
|
|
106
|
+
},
|
|
107
|
+
deletePopUpEvent: function(){
|
|
108
|
+
const rowId = dynamicData.path.split(".")[1];
|
|
109
|
+
sessionStorage.setItem('rowId',rowId);
|
|
110
|
+
store.updateDialog("popUpPageMasterEvent");
|
|
111
|
+
},
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
copyPasteElement: function(){
|
|
115
|
+
Component(store, dynamicData, submitHandler, service).copyPasteElement(store,this.setPage.bind(this));
|
|
116
|
+
},
|
|
117
|
+
|
|
118
|
+
RemoveItemButton: function(){
|
|
119
|
+
Component(store, dynamicData, submitHandler, service).RemoveItemButton(store)
|
|
80
120
|
},
|
|
121
|
+
|
|
81
122
|
}
|
|
82
123
|
};
|