impaktapps-ui-builder 0.0.591 → 0.0.592-alpha.10
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 +384 -300
- 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/buildCard.d.ts +1 -1
- package/dist/src/impaktapps-ui-builder/builder/build/buildUiSchema.d.ts +1 -1
- package/dist/src/impaktapps-ui-builder/builder/build/uischema/buildPropertiesSection.d.ts +2 -0
- package/dist/src/impaktapps-ui-builder/builder/build/uischema/card.d.ts +104 -83
- package/dist/src/impaktapps-ui-builder/builder/build/uischema/graph.d.ts +0 -1
- package/dist/src/impaktapps-ui-builder/builder/build/uischema/validationSections.d.ts +1 -1
- 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/package.json +1 -1
- package/src/impaktapps-ui-builder/builder/build/buildCard.ts +6 -6
- package/src/impaktapps-ui-builder/builder/build/buildFileInput.ts +1 -1
- package/src/impaktapps-ui-builder/builder/build/buildHorizontalBarGraph.ts +4 -0
- package/src/impaktapps-ui-builder/builder/build/buildPieGraph.ts +3 -1
- 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/buildSchema.ts +1 -1
- package/src/impaktapps-ui-builder/builder/build/buildStackBarGraph.ts +3 -0
- package/src/impaktapps-ui-builder/builder/build/buildUiSchema.ts +8 -7
- package/src/impaktapps-ui-builder/builder/build/uischema/apiSection.ts +10 -10
- package/src/impaktapps-ui-builder/builder/build/uischema/buildPropertiesSection.ts +65 -47
- package/src/impaktapps-ui-builder/builder/build/uischema/card.ts +132 -90
- package/src/impaktapps-ui-builder/builder/build/uischema/coreSection.ts +11 -11
- package/src/impaktapps-ui-builder/builder/build/uischema/dateInputField.ts +3 -3
- package/src/impaktapps-ui-builder/builder/build/uischema/file.ts +2 -2
- package/src/impaktapps-ui-builder/builder/build/uischema/graph.ts +0 -1
- package/src/impaktapps-ui-builder/builder/build/uischema/leaderBoard.ts +6 -7
- package/src/impaktapps-ui-builder/builder/build/uischema/multiSelect.ts +1 -1
- package/src/impaktapps-ui-builder/builder/build/uischema/refresh.ts +3 -3
- package/src/impaktapps-ui-builder/builder/build/uischema/selectInputField.ts +1 -1
- package/src/impaktapps-ui-builder/builder/build/uischema/textInputField.ts +1 -1
- package/src/impaktapps-ui-builder/builder/build/uischema/validationSections.ts +3 -3
- package/src/impaktapps-ui-builder/builder/build/uischema/valueTab.ts +3 -3
- package/src/impaktapps-ui-builder/builder/elements/UiSchema/Component/schema.ts +1 -0
- package/src/impaktapps-ui-builder/builder/elements/UiSchema/Component/uiSchema.ts +15 -31
- package/src/impaktapps-ui-builder/builder/elements/UiSchema/PageMaster/uiSchema.ts +18 -11
- package/src/impaktapps-ui-builder/builder/elements/UiSchema/event/uiSchema.ts +7 -16
- package/src/impaktapps-ui-builder/builder/services/component.ts +15 -22
- package/src/impaktapps-ui-builder/builder/services/event.ts +33 -7
- package/src/impaktapps-ui-builder/builder/services/pageMaster.ts +12 -12
- package/src/impaktapps-ui-builder/builder/services/utils.ts +12 -12
- package/src/impaktapps-ui-builder/lib/index.ts +1 -1
- package/src/impaktapps-ui-builder/runtime/services/events.ts +1 -1
- package/src/impaktapps-ui-builder/runtime/services/service.ts +7 -5
|
@@ -1,7 +1,7 @@
|
|
|
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 } from "./utils";
|
|
5
5
|
import { APISection } from "../build/uischema/apiSection";
|
|
6
6
|
import { getRadioInputField, getSelectField, getTextArea } from "../build/uischema/buildPropertiesSection";
|
|
7
7
|
import { refreshSectionUiSchema } from "../build/uischema/refresh";
|
|
@@ -29,8 +29,20 @@ export default (
|
|
|
29
29
|
if (handlerType) {
|
|
30
30
|
if (handlerType === "custom") {
|
|
31
31
|
uiSchema.elements[1].elements[0].elements[2] = getRadioInputField("isSync","Run in Sync",["Yes","No"])
|
|
32
|
-
|
|
33
|
-
|
|
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)
|
|
34
46
|
schema.required = ["eventType", "Handler", "eventCode"]
|
|
35
47
|
|
|
36
48
|
} else if (handlerType === "api") {
|
|
@@ -38,12 +50,26 @@ export default (
|
|
|
38
50
|
uiSchema.elements[1].elements[0].elements[3] = APISection;
|
|
39
51
|
schema.required = ["eventType", "Handler", "method", "path"]
|
|
40
52
|
} else if (handlerType === "inBuiltFunction") {
|
|
53
|
+
|
|
41
54
|
uiSchema.elements[1].elements[0].elements[2] = getSelectField("inBuiltFunctionType", "Function Name", [
|
|
42
55
|
{ label: "RankProvider", value: "RankProvider" },
|
|
43
56
|
{ label: "Download File", value: "downloadFile" },
|
|
44
57
|
{ label: "Download Blob File", value: "downloadBlobFile" }
|
|
45
58
|
])
|
|
46
|
-
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);
|
|
47
73
|
schema.required = ["eventType", "Handler", "inBuiltFunctionType"]
|
|
48
74
|
} else if (handlerType === "refresh") {
|
|
49
75
|
uiSchema.elements[1].elements[0].elements[2] = emptyBox;
|
|
@@ -85,7 +111,7 @@ export default (
|
|
|
85
111
|
if (!Array.isArray(store.formData.events)) {
|
|
86
112
|
store.formData.events = []
|
|
87
113
|
}
|
|
88
|
-
|
|
114
|
+
saveFormdataInSessionStorage(store.ctx.core.data, path)
|
|
89
115
|
const finalPath = `${path}.events[${store.formData?.events?.length}]`
|
|
90
116
|
store.searchParams.set("path", finalPath)
|
|
91
117
|
store.setSearchParams(store.searchParams)
|
|
@@ -94,7 +120,7 @@ export default (
|
|
|
94
120
|
editEvent: function () {
|
|
95
121
|
const rowId = dynamicData.path.split(".")[1];
|
|
96
122
|
const path = store.searchParams?.get("path");
|
|
97
|
-
|
|
123
|
+
saveFormdataInSessionStorage(store.ctx.core.data, path)
|
|
98
124
|
const finalPath = `${path}.events[${rowId}]`
|
|
99
125
|
store.searchParams.set("path", finalPath)
|
|
100
126
|
store.setSearchParams(store.searchParams)
|
|
@@ -110,7 +136,7 @@ export default (
|
|
|
110
136
|
},
|
|
111
137
|
deletePopUpEvent: function(){
|
|
112
138
|
const rowId = dynamicData.path.split(".")[1];
|
|
113
|
-
|
|
139
|
+
sessionStorage.setItem('rowId',rowId);
|
|
114
140
|
store.updateDialog("popUpEvent");
|
|
115
141
|
}
|
|
116
142
|
}
|
|
@@ -2,7 +2,7 @@ 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 {
|
|
@@ -26,11 +26,11 @@ export default (funcParams: funcParamsProps) => {
|
|
|
26
26
|
getFormdata: async function () {
|
|
27
27
|
const id = store.searchParams?.get("id");
|
|
28
28
|
const config: any = await funcParams.pageConfigProvider(id)
|
|
29
|
-
const formData =
|
|
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 () {
|
|
@@ -40,7 +40,7 @@ export default (funcParams: funcParamsProps) => {
|
|
|
40
40
|
return PageMasterSchema;
|
|
41
41
|
},
|
|
42
42
|
backHandler: () => {
|
|
43
|
-
|
|
43
|
+
sessionStorage.removeItem("pageFormdata")
|
|
44
44
|
store.navigate("/PageMasterRecords");
|
|
45
45
|
},
|
|
46
46
|
onAddClickHandler: function () {
|
|
@@ -48,7 +48,7 @@ export default (funcParams: funcParamsProps) => {
|
|
|
48
48
|
if (!Array.isArray(store.formData.elements)) {
|
|
49
49
|
store.formData.elements = []
|
|
50
50
|
}
|
|
51
|
-
const response =
|
|
51
|
+
const response = saveFormdataInSessionStorage(store.ctx.core.data)
|
|
52
52
|
if (id) {
|
|
53
53
|
store.navigate(
|
|
54
54
|
`/Component?path=${`elements[${response?.elements.length}]`}&id=${id}`
|
|
@@ -72,33 +72,33 @@ export default (funcParams: funcParamsProps) => {
|
|
|
72
72
|
if (!Array.isArray(store.formData.events)) {
|
|
73
73
|
store.formData.events = []
|
|
74
74
|
}
|
|
75
|
-
|
|
75
|
+
saveFormdataInSessionStorage(store.ctx.core.data)
|
|
76
76
|
const finalPath = `events[${store.formData.events.length}]`
|
|
77
77
|
store.navigate(`/ComponentEvents?path=${finalPath}&id=${id}`)
|
|
78
78
|
},
|
|
79
79
|
editEvent: function () {
|
|
80
80
|
const rowId = dynamicData.path.split(".")[1];
|
|
81
81
|
const id = store.searchParams?.get("id");
|
|
82
|
-
|
|
82
|
+
saveFormdataInSessionStorage(store.ctx.core.data)
|
|
83
83
|
const finalPath = `events[${rowId}]`
|
|
84
84
|
store.navigate(`/ComponentEvents?path=${finalPath}&id=${id}`)
|
|
85
85
|
},
|
|
86
86
|
deleteEvent: function () {
|
|
87
|
-
const rowId =
|
|
87
|
+
const rowId = sessionStorage.getItem('rowId');
|
|
88
88
|
store.formData.events.splice(rowId, 1);
|
|
89
|
-
const response =
|
|
89
|
+
const response = saveFormdataInSessionStorage(store.ctx.core.data)
|
|
90
90
|
store.setFormdata(response);
|
|
91
91
|
store.updateDialog("popUpPageMasterEvent");
|
|
92
|
-
|
|
92
|
+
sessionStorage.removeItem('rowId');
|
|
93
93
|
},
|
|
94
94
|
deletePopUpComponent: function(){
|
|
95
95
|
const rowId = dynamicData.path.split(".")[1];
|
|
96
|
-
|
|
96
|
+
sessionStorage.setItem('rowId',rowId);
|
|
97
97
|
store.updateDialog("popUpPageMasterComponent");
|
|
98
98
|
},
|
|
99
99
|
deletePopUpEvent: function(){
|
|
100
100
|
const rowId = dynamicData.path.split(".")[1];
|
|
101
|
-
|
|
101
|
+
sessionStorage.setItem('rowId',rowId);
|
|
102
102
|
store.updateDialog("popUpPageMasterEvent");
|
|
103
103
|
},
|
|
104
104
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import buildConfig from "../build/buildConfig";
|
|
2
2
|
import _ from "lodash";
|
|
3
3
|
|
|
4
|
-
const
|
|
5
|
-
|
|
4
|
+
const clearFromSessionStorage = () => {
|
|
5
|
+
sessionStorage.removeItem("pageFormdata")
|
|
6
6
|
}
|
|
7
|
-
export default
|
|
7
|
+
export default clearFromSessionStorage;
|
|
8
8
|
export const getNavigationHistory = (config: any, path: string | undefined) => {
|
|
9
9
|
if (path) {
|
|
10
10
|
let urlRoutes: string = config.name;
|
|
@@ -31,20 +31,20 @@ export const getNavigationHistory = (config: any, path: string | undefined) => {
|
|
|
31
31
|
return undefined;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
export const
|
|
34
|
+
export const saveFormdataInSessionStorage = (formData: any, path?: string) => {
|
|
35
35
|
let updatedFormdata: any;
|
|
36
36
|
if (path) {
|
|
37
|
-
const pageFormdata =
|
|
37
|
+
const pageFormdata = getFormdataFromSessionStorage()
|
|
38
38
|
updatedFormdata = _.set(pageFormdata, path, buildConfig(formData));
|
|
39
39
|
} else {
|
|
40
40
|
updatedFormdata = buildConfig(formData)
|
|
41
41
|
}
|
|
42
|
-
|
|
42
|
+
sessionStorage.setItem("pageFormdata", JSON.stringify(updatedFormdata))
|
|
43
43
|
return updatedFormdata;
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
export const
|
|
47
|
-
const pageFormdata =
|
|
46
|
+
export const getFormdataFromSessionStorage = (path?: string) => {
|
|
47
|
+
const pageFormdata = sessionStorage.getItem("pageFormdata") ? JSON.parse(sessionStorage.getItem("pageFormdata")) : undefined;
|
|
48
48
|
let returnValue: any;
|
|
49
49
|
if (path) {
|
|
50
50
|
returnValue = _.get(pageFormdata, path)
|
|
@@ -60,8 +60,8 @@ export const getFormdataFromLocalStorage = (path?: string) => {
|
|
|
60
60
|
export async function saveHandler(store, service, submitHandler, pageName?: string) {
|
|
61
61
|
const id = store.searchParams?.get("id");
|
|
62
62
|
const path = store.searchParams?.get("path");
|
|
63
|
-
|
|
64
|
-
const config = JSON.parse(
|
|
63
|
+
saveFormdataInSessionStorage(store.ctx.core.data, path);
|
|
64
|
+
const config = JSON.parse(sessionStorage.getItem("pageFormdata"));
|
|
65
65
|
if (_.isEmpty(store.ctx.core.errors)) {
|
|
66
66
|
try {
|
|
67
67
|
const saveReturn = await submitHandler(store, service, config);
|
|
@@ -74,7 +74,7 @@ export async function saveHandler(store, service, submitHandler, pageName?: stri
|
|
|
74
74
|
|
|
75
75
|
export const navigateHandler = (store, isSubmitted, pageName?: string | boolean) => {
|
|
76
76
|
if (isSubmitted) {
|
|
77
|
-
|
|
77
|
+
sessionStorage.removeItem("pageFormdata");
|
|
78
78
|
store.navigate(pageName || -1)
|
|
79
79
|
store.setNotify({
|
|
80
80
|
SuccessMessage: "Submit Successfully",
|
|
@@ -92,7 +92,7 @@ export const navigateHandler = (store, isSubmitted, pageName?: string | boolean)
|
|
|
92
92
|
export function okHandler(store) {
|
|
93
93
|
const path = store.searchParams?.get("path");
|
|
94
94
|
if (_.isEmpty(store.ctx.core.errors)) {
|
|
95
|
-
|
|
95
|
+
saveFormdataInSessionStorage(store.ctx.core.data, path)
|
|
96
96
|
store.navigate(-1)
|
|
97
97
|
store.setNotify({
|
|
98
98
|
SuccessMessage: "Save Successfully",
|
|
@@ -7,4 +7,4 @@ export { schema} from "../builder/build/buildUiSchema"
|
|
|
7
7
|
export {default as buildConfig} from "../builder/build/buildConfig"
|
|
8
8
|
export {default as buildUiSchema} from "../builder/build/buildUiSchema"
|
|
9
9
|
export {buildSchema} from "../builder/build/buildUiSchema"
|
|
10
|
-
export {default as
|
|
10
|
+
export {default as clearFromSessionStorage} from "../builder/services/utils"
|
|
@@ -207,7 +207,7 @@ const buildBodyFormat = (body: any[], formData: any, userValue: any, store: any)
|
|
|
207
207
|
}
|
|
208
208
|
else if (elem?.value?.startsWith("$local")) {
|
|
209
209
|
const finalpath = elem.value.substring(7);
|
|
210
|
-
const value = JSON.parse(
|
|
210
|
+
const value = JSON.parse(sessionStorage.getItem(finalpath) || '""')
|
|
211
211
|
finalBody[elem.key] = value;
|
|
212
212
|
}
|
|
213
213
|
else if (elem?.value?.startsWith("$")) {
|
|
@@ -12,7 +12,7 @@ const notifyUiSchema = {
|
|
|
12
12
|
},
|
|
13
13
|
layout: 6,
|
|
14
14
|
};
|
|
15
|
-
|
|
15
|
+
|
|
16
16
|
interface funcParamsProps {
|
|
17
17
|
store: any,
|
|
18
18
|
dynamicData: any,
|
|
@@ -62,6 +62,7 @@ export const extractEvents = (eventConfig: any) => {
|
|
|
62
62
|
};
|
|
63
63
|
export default (funcParams: funcParamsProps) => {
|
|
64
64
|
eventGroups = {}
|
|
65
|
+
const formDataHolder = {}
|
|
65
66
|
if (pageData) {
|
|
66
67
|
if ((!isEmpty(pageData)) && typeof pageData === "object") {
|
|
67
68
|
eventGroups = extractEvents(pageData?.config)
|
|
@@ -77,12 +78,12 @@ export default (funcParams: funcParamsProps) => {
|
|
|
77
78
|
setPage: async function () {
|
|
78
79
|
funcParams.store.setFormdata({});
|
|
79
80
|
funcParams.store.newData = {};
|
|
80
|
-
const pageBasicDetailString =
|
|
81
|
+
const pageBasicDetailString = sessionStorage.getItem("pagemasterMetaData")
|
|
81
82
|
if (pageBasicDetailString) {
|
|
82
83
|
pageData = JSON.parse(pageBasicDetailString)
|
|
83
84
|
} else {
|
|
84
85
|
pageData = await funcParams.pageDataProvider();
|
|
85
|
-
|
|
86
|
+
sessionStorage.setItem("pagemasterMetaData", JSON.stringify({
|
|
86
87
|
schema: pageData?.schema,
|
|
87
88
|
uiSchema: pageData?.uiSchema, config: pageData?.config
|
|
88
89
|
}))
|
|
@@ -157,7 +158,7 @@ export default (funcParams: funcParamsProps) => {
|
|
|
157
158
|
height: 0,
|
|
158
159
|
margin: 0,
|
|
159
160
|
top: 0,
|
|
160
|
-
right: '
|
|
161
|
+
right: {xs: '12px', sm: '84px'},
|
|
161
162
|
position: 'absolute',
|
|
162
163
|
fontSize: '12px',
|
|
163
164
|
cursor: 'pointer',
|
|
@@ -170,7 +171,7 @@ export default (funcParams: funcParamsProps) => {
|
|
|
170
171
|
{
|
|
171
172
|
type: "Control",
|
|
172
173
|
scope: "#/properties/text",
|
|
173
|
-
|
|
174
|
+
|
|
174
175
|
options: {
|
|
175
176
|
widget: "Box",
|
|
176
177
|
},
|
|
@@ -180,6 +181,7 @@ export default (funcParams: funcParamsProps) => {
|
|
|
180
181
|
onClick: "backHandler"
|
|
181
182
|
},
|
|
182
183
|
style: {
|
|
184
|
+
display: {xs: 'none', sm: "flex"},
|
|
183
185
|
textAlign: 'left',
|
|
184
186
|
lineHeight: 1,
|
|
185
187
|
height: 0,
|