impaktapps-ui-builder 0.0.347 → 0.0.348
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 +36 -53
- package/dist/impaktapps-ui-builder.es.js.map +1 -1
- package/dist/impaktapps-ui-builder.umd.js +11 -11
- package/dist/impaktapps-ui-builder.umd.js.map +1 -1
- package/dist/src/impaktapps-ui-builder/builder/services/component.d.ts +1 -1
- package/dist/src/impaktapps-ui-builder/builder/services/event.d.ts +2 -2
- package/dist/src/impaktapps-ui-builder/builder/services/pageMaster.d.ts +4 -3
- package/package.json +1 -1
- package/src/impaktapps-ui-builder/builder/elements/UiSchema/Component/uiSchema.ts +1 -1
- package/src/impaktapps-ui-builder/builder/elements/UiSchema/PageMaster/uiSchema.ts +1 -1
- package/src/impaktapps-ui-builder/builder/elements/UiSchema/event/uiSchema.ts +1 -1
- package/src/impaktapps-ui-builder/builder/services/component.ts +3 -28
- package/src/impaktapps-ui-builder/builder/services/event.ts +14 -23
- package/src/impaktapps-ui-builder/builder/services/pageMaster.ts +29 -15
|
@@ -5,7 +5,7 @@ declare const _default: (store: any, dynamicData: any, submitHandler: any, servi
|
|
|
5
5
|
getFormdata: () => any;
|
|
6
6
|
getSchema: () => any;
|
|
7
7
|
okHandler: () => void;
|
|
8
|
-
|
|
8
|
+
saveHandler: () => Promise<void>;
|
|
9
9
|
onChange: () => void;
|
|
10
10
|
editComponents: () => void;
|
|
11
11
|
deleteComponents: () => void;
|
|
@@ -76,9 +76,9 @@ declare const _default: (store: any, dynamicData: any, submitHandler: any, servi
|
|
|
76
76
|
};
|
|
77
77
|
required: string[];
|
|
78
78
|
};
|
|
79
|
-
savePageHandler: () => Promise<void>;
|
|
80
|
-
onChange: () => void;
|
|
81
79
|
okHandler: () => void;
|
|
80
|
+
saveHandler: () => Promise<void>;
|
|
81
|
+
onChange: () => void;
|
|
82
82
|
addEvent: () => void;
|
|
83
83
|
editEvent: () => void;
|
|
84
84
|
deleteEvent: () => void;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
export declare function saveHandler(store: any, service: any, submitHandler: any,
|
|
2
|
-
export declare const
|
|
1
|
+
export declare function saveHandler(store: any, service: any, submitHandler: any, pageName?: string): Promise<void>;
|
|
2
|
+
export declare const navigateHandler: (store: any, isSubmitted: any, pageName?: string | boolean) => void;
|
|
3
|
+
export declare function okHandler(store: any): void;
|
|
3
4
|
interface funcParamsProps {
|
|
4
5
|
store: any;
|
|
5
6
|
dynamicData: any;
|
|
@@ -51,7 +52,7 @@ declare const _default: (funcParams: funcParamsProps) => {
|
|
|
51
52
|
};
|
|
52
53
|
backHandler: () => void;
|
|
53
54
|
onAddClickHandler: () => void;
|
|
54
|
-
|
|
55
|
+
saveHandler: () => Promise<void>;
|
|
55
56
|
Edit_Components: () => void;
|
|
56
57
|
Delete_Components: () => void;
|
|
57
58
|
eventAddHandler: () => void;
|
package/package.json
CHANGED
|
@@ -9,7 +9,7 @@ import { StyleSection } from "../build/uischema/styleSection";
|
|
|
9
9
|
import { TableSection } from "../build/uischema/tableSection";
|
|
10
10
|
import { ValueTab } from "../build/uischema/valueTab";
|
|
11
11
|
import { ValidationSection } from "../build/uischema/validationSections";
|
|
12
|
-
import {
|
|
12
|
+
import { navigateHandler, okHandler, saveHandler } from "./pageMaster";
|
|
13
13
|
const sectionLabels = {
|
|
14
14
|
Select: ["Core", "Properties","Value", "style", "Event","Validation"],
|
|
15
15
|
MultipleSelect: ["Core", "Properties","Value", "style", "Event","Validation"],
|
|
@@ -77,33 +77,8 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
|
|
|
77
77
|
getSchema: function () {
|
|
78
78
|
return ComponentSchema;
|
|
79
79
|
},
|
|
80
|
-
okHandler:
|
|
81
|
-
|
|
82
|
-
console.log(store.ctx.core.errors)
|
|
83
|
-
if (_.isEmpty(store.ctx.core.errors)) {
|
|
84
|
-
saveFormdataInLocalStorage(store.ctx.core.data,path)
|
|
85
|
-
store.navigate(-1)
|
|
86
|
-
store.setNotify({
|
|
87
|
-
SuccessMessage: "Save Successfully",
|
|
88
|
-
Success: true,
|
|
89
|
-
});
|
|
90
|
-
} else {
|
|
91
|
-
store.setValidation("ValidateAndShow");
|
|
92
|
-
store.setNotify({
|
|
93
|
-
Fail:true,
|
|
94
|
-
FailMessage:"Errors on Page"
|
|
95
|
-
})
|
|
96
|
-
}
|
|
97
|
-
},
|
|
98
|
-
savePageHandler: async () => {
|
|
99
|
-
const id = store.searchParams?.get("id");
|
|
100
|
-
const path = store.searchParams?.get("path");
|
|
101
|
-
saveFormdataInLocalStorage(store.ctx.core.data, path);
|
|
102
|
-
const config = JSON.parse(localStorage.getItem("pageFormdata"));
|
|
103
|
-
const isSubmitted = await saveHandler(store, service, submitHandler,config);
|
|
104
|
-
navigation(store,isSubmitted,`/PageMaster?id=${id}`)
|
|
105
|
-
},
|
|
106
|
-
|
|
80
|
+
okHandler:()=>okHandler(store),
|
|
81
|
+
saveHandler: async ()=> await saveHandler(store,service,submitHandler,"PageMaster"),
|
|
107
82
|
onChange: function () {
|
|
108
83
|
if (
|
|
109
84
|
store?.formData?.type !== store?.newData?.type &&
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { EventSchema } from "../elements/UiSchema/event/schema";
|
|
1
|
+
import { EventSchema } from "../elements/UiSchema/event/schema";
|
|
2
2
|
import { EventUiSchema } from "../elements/UiSchema/event/uiSchema";
|
|
3
3
|
import Component from "./component";
|
|
4
4
|
import { saveFormdataInLocalStorage } from "./saveHandler";
|
|
5
5
|
import { APISection } from "../build/uischema/apiSection";
|
|
6
|
-
import
|
|
6
|
+
import { okHandler, saveHandler } from "./pageMaster";
|
|
7
7
|
import { getSelectField, getTextArea } from "../build/uischema/buildPropertiesSection";
|
|
8
8
|
import { refreshSectionUiSchema } from "../build/uischema/refresh";
|
|
9
9
|
import _ from "lodash";
|
|
@@ -11,7 +11,7 @@ import _ from "lodash";
|
|
|
11
11
|
export default (
|
|
12
12
|
store: any,
|
|
13
13
|
dynamicData: any,
|
|
14
|
-
submitHandler: any,
|
|
14
|
+
submitHandler: any,
|
|
15
15
|
service: any
|
|
16
16
|
) => {
|
|
17
17
|
return {
|
|
@@ -20,63 +20,54 @@ export default (
|
|
|
20
20
|
store.setFormdata(formdata);
|
|
21
21
|
const schema = await this.getSchema();
|
|
22
22
|
store.setSchema(schema);
|
|
23
|
-
|
|
23
|
+
this.refreshPage(formdata.Handler, store)
|
|
24
24
|
},
|
|
25
25
|
refreshPage: (handlerType: any, store: any) => {
|
|
26
26
|
const uiSchema = _.cloneDeep(EventUiSchema);
|
|
27
|
-
const schema:any = _.cloneDeep(EventSchema)
|
|
27
|
+
const schema: any = _.cloneDeep(EventSchema)
|
|
28
28
|
if (handlerType) {
|
|
29
29
|
if (handlerType === "custom") {
|
|
30
30
|
uiSchema.elements[1].elements[0].elements[2] = getTextArea("eventCode", "Write Custom Code", false)
|
|
31
|
-
schema.required = ["eventType","Handler","eventCode"]
|
|
31
|
+
schema.required = ["eventType", "Handler", "eventCode"]
|
|
32
32
|
|
|
33
33
|
} else if (handlerType === "api") {
|
|
34
34
|
uiSchema.elements[1].elements[0].elements[2] = APISection;
|
|
35
|
-
schema.required = ["eventType","Handler","method","path"]
|
|
35
|
+
schema.required = ["eventType", "Handler", "method", "path"]
|
|
36
36
|
} else if (handlerType === "inBuiltFunction") {
|
|
37
37
|
uiSchema.elements[1].elements[0].elements[2] = getSelectField("inBuiltFunctionType", "Function Name", [
|
|
38
38
|
{ label: "RankProvider", value: "RankProvider" },
|
|
39
39
|
{ label: "Download File", value: "downloadFile" },
|
|
40
40
|
])
|
|
41
41
|
uiSchema.elements[1].elements[0].elements[3] = getTextArea("funcParametersCode", "Write Custom Code for Functions Parameter", true, { xs: 12, sm: 12, md: 6 });
|
|
42
|
-
schema.required = ["eventType","Handler","inBuiltFunctionType"]
|
|
42
|
+
schema.required = ["eventType", "Handler", "inBuiltFunctionType"]
|
|
43
43
|
} else if (handlerType === "refresh") {
|
|
44
44
|
uiSchema.elements[1].elements[0].elements[2] = refreshSectionUiSchema;
|
|
45
45
|
schema.properties.refreshElements.required = ["value"]
|
|
46
46
|
schema.properties.refreshElements.items.required = ["value"]
|
|
47
|
-
schema.required = ["eventType","Handler","refreshElements"]
|
|
47
|
+
schema.required = ["eventType", "Handler", "refreshElements"]
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
store.setSchema(schema)
|
|
51
51
|
store.setUiSchema(uiSchema)
|
|
52
52
|
},
|
|
53
53
|
|
|
54
|
-
getFormData: Component(store, dynamicData,submitHandler,service).getFormdata,
|
|
54
|
+
getFormData: Component(store, dynamicData, submitHandler, service).getFormdata,
|
|
55
55
|
getUiSchema: function () {
|
|
56
56
|
return EventUiSchema;
|
|
57
57
|
},
|
|
58
58
|
getSchema: () => {
|
|
59
59
|
return EventSchema;
|
|
60
60
|
},
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
const path = store.searchParams?.get("path");
|
|
64
|
-
saveFormdataInLocalStorage(store.ctx.core.data, path);
|
|
65
|
-
const config = JSON.parse(localStorage.getItem("pageFormdata"));
|
|
66
|
-
const isSubmitted = await saveHandler(store, service, submitHandler,config);
|
|
67
|
-
navigation(store,isSubmitted,`/PageMaster?id=${id}`)
|
|
68
|
-
},
|
|
69
|
-
|
|
61
|
+
okHandler: () => okHandler(store),
|
|
62
|
+
saveHandler: async () => await saveHandler(store, service, submitHandler,"PageMaster"),
|
|
70
63
|
onChange: function () {
|
|
71
64
|
if (
|
|
72
65
|
store?.formData?.Handler !== store?.newData?.Handler &&
|
|
73
66
|
store?.newData?.Handler !== undefined
|
|
74
67
|
) {
|
|
75
|
-
this.refreshPage(store.newData.Handler||store.formdata.Handler,store)
|
|
68
|
+
this.refreshPage(store.newData.Handler || store.formdata.Handler, store)
|
|
76
69
|
}
|
|
77
70
|
},
|
|
78
|
-
|
|
79
|
-
okHandler: Component(store, dynamicData,submitHandler,service).okHandler,
|
|
80
71
|
addEvent: function () {
|
|
81
72
|
const path = store.searchParams?.get("path");
|
|
82
73
|
if (!Array.isArray(store.formData.events)) {
|
|
@@ -98,7 +89,7 @@ export default (
|
|
|
98
89
|
this.setPage()
|
|
99
90
|
|
|
100
91
|
},
|
|
101
|
-
deleteEvent: Component(store, dynamicData,submitHandler,service).deleteEvent,
|
|
92
|
+
deleteEvent: Component(store, dynamicData, submitHandler, service).deleteEvent,
|
|
102
93
|
backHandler: function () {
|
|
103
94
|
store.navigate(-1)
|
|
104
95
|
},
|
|
@@ -5,23 +5,24 @@ import Component from "./component";
|
|
|
5
5
|
import { getFormdataFromLocalStorage, saveFormdataInLocalStorage } from "./saveHandler";
|
|
6
6
|
import { schema } from "../build/buildUiSchema";
|
|
7
7
|
|
|
8
|
-
export async function saveHandler(store, service, submitHandler,
|
|
9
|
-
|
|
8
|
+
export async function saveHandler(store, service, submitHandler,pageName?:string) {
|
|
9
|
+
const id = store.searchParams?.get("id");
|
|
10
|
+
const path = store.searchParams?.get("path");
|
|
11
|
+
saveFormdataInLocalStorage(store.ctx.core.data, path);
|
|
12
|
+
const config = JSON.parse(localStorage.getItem("pageFormdata"));
|
|
10
13
|
if (_.isEmpty(store.ctx.core.errors)) {
|
|
11
14
|
try {
|
|
12
|
-
const saveReturn = await submitHandler(store, service,config);
|
|
13
|
-
|
|
15
|
+
const saveReturn = await submitHandler(store, service, config);
|
|
16
|
+
navigateHandler(store,true,pageName?`/${pageName}?id=${id}`:false)
|
|
14
17
|
} catch (err) {
|
|
15
|
-
|
|
18
|
+
navigateHandler(store,false)
|
|
16
19
|
}
|
|
17
20
|
}
|
|
18
|
-
return isTrue;
|
|
19
21
|
}
|
|
20
|
-
export const
|
|
22
|
+
export const navigateHandler = (store, isSubmitted, pageName?: string | boolean) => {
|
|
21
23
|
if (isSubmitted) {
|
|
22
24
|
localStorage.removeItem("pageFormdata");
|
|
23
|
-
|
|
24
|
-
store.navigate(pageName||-1)
|
|
25
|
+
store.navigate(pageName || -1)
|
|
25
26
|
store.setNotify({
|
|
26
27
|
SuccessMessage: "Submit Successfully",
|
|
27
28
|
Success: true,
|
|
@@ -34,6 +35,24 @@ export const navigation = (store, isSubmitted, pageName?:string|undefined) => {
|
|
|
34
35
|
});
|
|
35
36
|
}
|
|
36
37
|
};
|
|
38
|
+
export function okHandler (store) {
|
|
39
|
+
const path = store.searchParams?.get("path");
|
|
40
|
+
console.log(store.ctx.core.errors)
|
|
41
|
+
if (_.isEmpty(store.ctx.core.errors)) {
|
|
42
|
+
saveFormdataInLocalStorage(store.ctx.core.data,path)
|
|
43
|
+
store.navigate(-1)
|
|
44
|
+
store.setNotify({
|
|
45
|
+
SuccessMessage: "Save Successfully",
|
|
46
|
+
Success: true,
|
|
47
|
+
});
|
|
48
|
+
} else {
|
|
49
|
+
store.setValidation("ValidateAndShow");
|
|
50
|
+
store.setNotify({
|
|
51
|
+
Fail:true,
|
|
52
|
+
FailMessage:"Errors on Page"
|
|
53
|
+
})
|
|
54
|
+
}
|
|
55
|
+
}
|
|
37
56
|
|
|
38
57
|
interface funcParamsProps {
|
|
39
58
|
store: any,
|
|
@@ -83,12 +102,7 @@ export default (funcParams: funcParamsProps) => {
|
|
|
83
102
|
`/Component?path=${`elements[${response?.elements.length}]`}&id=${id}`
|
|
84
103
|
);
|
|
85
104
|
},
|
|
86
|
-
|
|
87
|
-
saveFormdataInLocalStorage(store.ctx.core.data);
|
|
88
|
-
const config = JSON.parse(localStorage.getItem("pageFormdata"));
|
|
89
|
-
const isSubmitted = await saveHandler(store, service, submitHandler,config);
|
|
90
|
-
navigation(store,isSubmitted)
|
|
91
|
-
},
|
|
105
|
+
saveHandler: async ()=> await saveHandler(store,service,submitHandler),
|
|
92
106
|
Edit_Components: Component(store, dynamicData, submitHandler, service).editComponents,
|
|
93
107
|
Delete_Components: Component(store, dynamicData, submitHandler, service).deleteComponents,
|
|
94
108
|
eventAddHandler: function () {
|