impaktapps-ui-builder 0.0.341 → 0.0.343
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 +29 -23
- package/dist/impaktapps-ui-builder.es.js.map +1 -1
- package/dist/impaktapps-ui-builder.umd.js +6 -6
- package/dist/impaktapps-ui-builder.umd.js.map +1 -1
- package/dist/src/impaktapps-ui-builder/builder/services/component.d.ts +8 -8
- package/dist/src/impaktapps-ui-builder/builder/services/event.d.ts +8 -8
- package/dist/src/impaktapps-ui-builder/builder/services/pageMaster.d.ts +9 -9
- package/package.json +1 -1
- package/src/impaktapps-ui-builder/builder/services/component.ts +11 -9
- package/src/impaktapps-ui-builder/builder/services/event.ts +7 -5
- package/src/impaktapps-ui-builder/builder/services/pageMaster.ts +11 -9
|
@@ -2,17 +2,17 @@ export declare const refreshPage: (type: string, store: any) => void;
|
|
|
2
2
|
declare const _default: (store: any, dynamicData: any, submitHandler: any, service: any) => {
|
|
3
3
|
setPage: () => Promise<void>;
|
|
4
4
|
refreshPage: (type: string, store: any) => void;
|
|
5
|
-
getFormdata: () =>
|
|
5
|
+
getFormdata: () => any;
|
|
6
6
|
getSchema: () => any;
|
|
7
|
-
okHandler: () =>
|
|
7
|
+
okHandler: () => void;
|
|
8
8
|
savePageHandler: () => Promise<void>;
|
|
9
9
|
onChange: () => void;
|
|
10
|
-
editComponents: () =>
|
|
11
|
-
deleteComponents: () =>
|
|
12
|
-
deleteEvent: () =>
|
|
13
|
-
widgetAddClickHandler: () =>
|
|
14
|
-
eventEditHandler: () =>
|
|
15
|
-
eventAddHandler: () =>
|
|
10
|
+
editComponents: () => void;
|
|
11
|
+
deleteComponents: () => void;
|
|
12
|
+
deleteEvent: () => void;
|
|
13
|
+
widgetAddClickHandler: () => void;
|
|
14
|
+
eventEditHandler: () => void;
|
|
15
|
+
eventAddHandler: () => void;
|
|
16
16
|
backHandler: () => void;
|
|
17
17
|
};
|
|
18
18
|
export default _default;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
declare const _default: (store: any, dynamicData: any, submitHandler: any, service: any) => {
|
|
2
2
|
setPage: () => Promise<void>;
|
|
3
3
|
refreshPage: (handlerType: any, store: any) => void;
|
|
4
|
-
getFormData: () =>
|
|
5
|
-
getUiSchema: () =>
|
|
6
|
-
getSchema: () =>
|
|
4
|
+
getFormData: () => any;
|
|
5
|
+
getUiSchema: () => any;
|
|
6
|
+
getSchema: () => {
|
|
7
7
|
type: string;
|
|
8
8
|
properties: {
|
|
9
9
|
headers: {
|
|
@@ -75,13 +75,13 @@ declare const _default: (store: any, dynamicData: any, submitHandler: any, servi
|
|
|
75
75
|
};
|
|
76
76
|
};
|
|
77
77
|
required: string[];
|
|
78
|
-
}
|
|
78
|
+
};
|
|
79
79
|
savePageHandler: () => Promise<void>;
|
|
80
80
|
onChange: () => void;
|
|
81
|
-
okHandler: () =>
|
|
82
|
-
addEvent: () =>
|
|
83
|
-
editEvent: () =>
|
|
84
|
-
deleteEvent: () =>
|
|
81
|
+
okHandler: () => void;
|
|
82
|
+
addEvent: () => void;
|
|
83
|
+
editEvent: () => void;
|
|
84
|
+
deleteEvent: () => void;
|
|
85
85
|
backHandler: () => void;
|
|
86
86
|
};
|
|
87
87
|
export default _default;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare function saveHandler(store: any, service: any, submitHandler: any): Promise<boolean>;
|
|
1
|
+
export declare function saveHandler(store: any, service: any, submitHandler: any, config: any): Promise<boolean>;
|
|
2
2
|
interface funcParamsProps {
|
|
3
3
|
store: any;
|
|
4
4
|
dynamicData: any;
|
|
@@ -8,8 +8,8 @@ interface funcParamsProps {
|
|
|
8
8
|
}
|
|
9
9
|
declare const _default: (funcParams: funcParamsProps) => {
|
|
10
10
|
setPage: () => Promise<void>;
|
|
11
|
-
getFormdata: () =>
|
|
12
|
-
getUiSchema: () =>
|
|
11
|
+
getFormdata: () => any;
|
|
12
|
+
getUiSchema: () => any;
|
|
13
13
|
getSchema: () => {
|
|
14
14
|
type: string;
|
|
15
15
|
properties: {
|
|
@@ -49,12 +49,12 @@ declare const _default: (funcParams: funcParamsProps) => {
|
|
|
49
49
|
required: string[];
|
|
50
50
|
};
|
|
51
51
|
backHandler: () => void;
|
|
52
|
-
onAddClickHandler: () =>
|
|
52
|
+
onAddClickHandler: () => void;
|
|
53
53
|
savePageHandler: () => Promise<void>;
|
|
54
|
-
Edit_Components: () =>
|
|
55
|
-
Delete_Components: () =>
|
|
56
|
-
eventAddHandler: () =>
|
|
57
|
-
editEvent: () =>
|
|
58
|
-
deleteEvent: () =>
|
|
54
|
+
Edit_Components: () => void;
|
|
55
|
+
Delete_Components: () => void;
|
|
56
|
+
eventAddHandler: () => void;
|
|
57
|
+
editEvent: () => void;
|
|
58
|
+
deleteEvent: () => void;
|
|
59
59
|
};
|
|
60
60
|
export default _default;
|
package/package.json
CHANGED
|
@@ -70,14 +70,14 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
|
|
|
70
70
|
|
|
71
71
|
},
|
|
72
72
|
refreshPage:refreshPage,
|
|
73
|
-
getFormdata:
|
|
73
|
+
getFormdata: function () {
|
|
74
74
|
const path = store.searchParams?.get("path");
|
|
75
75
|
return getFormdataFromLocalStorage(path)
|
|
76
76
|
},
|
|
77
77
|
getSchema: function () {
|
|
78
78
|
return ComponentSchema;
|
|
79
79
|
},
|
|
80
|
-
okHandler:
|
|
80
|
+
okHandler: function () {
|
|
81
81
|
const path = store.searchParams?.get("path");
|
|
82
82
|
console.log(store.ctx.core.errors)
|
|
83
83
|
if (_.isEmpty(store.ctx.core.errors)) {
|
|
@@ -97,7 +97,9 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
|
|
|
97
97
|
},
|
|
98
98
|
savePageHandler: async () => {
|
|
99
99
|
const id = store.searchParams?.get("id");
|
|
100
|
-
|
|
100
|
+
saveFormdataInLocalStorage(store.ctx.core.data);
|
|
101
|
+
const config = localStorage.getItem("pageFormdata");
|
|
102
|
+
const isSubmitted = await saveHandler(store, service, submitHandler,config);
|
|
101
103
|
if (isSubmitted) {
|
|
102
104
|
localStorage.removeItem("pageFormdata");
|
|
103
105
|
store.navigate(`/PageMaster?id=${id}`);
|
|
@@ -122,7 +124,7 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
|
|
|
122
124
|
this.refreshPage(store?.newData?.type,store);
|
|
123
125
|
}
|
|
124
126
|
},
|
|
125
|
-
editComponents:
|
|
127
|
+
editComponents: function () {
|
|
126
128
|
const rowId = dynamicData.path.split(".")[1];
|
|
127
129
|
const path = store.searchParams?.get("path");
|
|
128
130
|
const id = store.searchParams?.get("id");
|
|
@@ -137,7 +139,7 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
|
|
|
137
139
|
store.navigate(`/Component?path=${`elements[${rowId}]`}&id=${id}`)
|
|
138
140
|
}
|
|
139
141
|
},
|
|
140
|
-
deleteComponents:
|
|
142
|
+
deleteComponents: function () {
|
|
141
143
|
const path = store.searchParams?.get("path");
|
|
142
144
|
const rowId = dynamicData.path.split(".")[1];
|
|
143
145
|
store.formData.elements.splice(rowId, 1);
|
|
@@ -145,14 +147,14 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
|
|
|
145
147
|
const data = path ? _.get(response, path) : response;
|
|
146
148
|
store.setFormdata(data);
|
|
147
149
|
},
|
|
148
|
-
deleteEvent:
|
|
150
|
+
deleteEvent: function () {
|
|
149
151
|
const path = store.searchParams?.get("path");
|
|
150
152
|
const rowId = dynamicData.path.split(".")[1];
|
|
151
153
|
store.formData.events.splice(rowId, 1);
|
|
152
154
|
const response = saveFormdataInLocalStorage(store.ctx.core.data, path)
|
|
153
155
|
store.setFormdata(_.get(response, path));
|
|
154
156
|
},
|
|
155
|
-
widgetAddClickHandler:
|
|
157
|
+
widgetAddClickHandler: function () {
|
|
156
158
|
if (!Array.isArray(store.formData.elements)) {
|
|
157
159
|
store.formData.elements = []
|
|
158
160
|
}
|
|
@@ -164,7 +166,7 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
|
|
|
164
166
|
this.setPage()
|
|
165
167
|
|
|
166
168
|
},
|
|
167
|
-
eventEditHandler:
|
|
169
|
+
eventEditHandler: function () {
|
|
168
170
|
const rowId = dynamicData.path.split(".")[1];
|
|
169
171
|
const path = store.searchParams?.get("path");
|
|
170
172
|
const id = store.searchParams?.get("id");
|
|
@@ -172,7 +174,7 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
|
|
|
172
174
|
const finalPath = `${path}.events[${rowId}]`
|
|
173
175
|
store.navigate(`/ComponentEvents?path=${finalPath}&id=${id}`)
|
|
174
176
|
},
|
|
175
|
-
eventAddHandler:
|
|
177
|
+
eventAddHandler: function () {
|
|
176
178
|
const path = store.searchParams?.get("path");
|
|
177
179
|
const id = store.searchParams?.get("id");
|
|
178
180
|
if (!Array.isArray(store.formData.events)) {
|
|
@@ -52,15 +52,17 @@ export default (
|
|
|
52
52
|
},
|
|
53
53
|
|
|
54
54
|
getFormData: Component(store, dynamicData,submitHandler,service).getFormdata,
|
|
55
|
-
getUiSchema:
|
|
55
|
+
getUiSchema: function () {
|
|
56
56
|
return EventUiSchema;
|
|
57
57
|
},
|
|
58
|
-
getSchema:
|
|
58
|
+
getSchema: () => {
|
|
59
59
|
return EventSchema;
|
|
60
60
|
},
|
|
61
61
|
savePageHandler: async () => {
|
|
62
62
|
const id = store.searchParams?.get("id");
|
|
63
|
-
|
|
63
|
+
saveFormdataInLocalStorage(store.ctx.core.data);
|
|
64
|
+
const config = localStorage.getItem("pageFormdata");
|
|
65
|
+
const isSubmitted = await saveHandler(store, service, submitHandler,config);
|
|
64
66
|
if (isSubmitted) {
|
|
65
67
|
localStorage.removeItem("pageFormdata");
|
|
66
68
|
store.navigate(`/PageMaster?id=${id}`);
|
|
@@ -87,7 +89,7 @@ export default (
|
|
|
87
89
|
},
|
|
88
90
|
|
|
89
91
|
okHandler: Component(store, dynamicData,submitHandler,service).okHandler,
|
|
90
|
-
addEvent:
|
|
92
|
+
addEvent: function () {
|
|
91
93
|
const path = store.searchParams?.get("path");
|
|
92
94
|
if (!Array.isArray(store.formData.events)) {
|
|
93
95
|
store.formData.events = []
|
|
@@ -98,7 +100,7 @@ export default (
|
|
|
98
100
|
store.setSearchParams(store.searchParams)
|
|
99
101
|
this.setPage()
|
|
100
102
|
},
|
|
101
|
-
editEvent:
|
|
103
|
+
editEvent: function () {
|
|
102
104
|
const rowId = dynamicData.path.split(".")[1];
|
|
103
105
|
const path = store.searchParams?.get("path");
|
|
104
106
|
saveFormdataInLocalStorage(store.ctx.core.data, path)
|
|
@@ -5,11 +5,11 @@ 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) {
|
|
8
|
+
export async function saveHandler(store, service, submitHandler, config) {
|
|
9
9
|
let isTrue = false;
|
|
10
10
|
if (_.isEmpty(store.ctx.core.errors)) {
|
|
11
11
|
try {
|
|
12
|
-
const saveReturn = await submitHandler(store, service);
|
|
12
|
+
const saveReturn = await submitHandler(store, service,config);
|
|
13
13
|
isTrue = true;
|
|
14
14
|
} catch (err) {
|
|
15
15
|
isTrue = false;
|
|
@@ -36,7 +36,7 @@ export default (funcParams: funcParamsProps) => {
|
|
|
36
36
|
store.setSchema(schema);
|
|
37
37
|
store.setUiSchema(uiSchema);
|
|
38
38
|
},
|
|
39
|
-
getFormdata:
|
|
39
|
+
getFormdata: function () {
|
|
40
40
|
const id = store.searchParams?.get("id");
|
|
41
41
|
const formData = getFormdataFromLocalStorage()
|
|
42
42
|
if (formData) {
|
|
@@ -45,7 +45,7 @@ export default (funcParams: funcParamsProps) => {
|
|
|
45
45
|
saveFormdataInLocalStorage(config)
|
|
46
46
|
return config
|
|
47
47
|
},
|
|
48
|
-
getUiSchema:
|
|
48
|
+
getUiSchema: function () {
|
|
49
49
|
return PageMasterUiSchema;
|
|
50
50
|
},
|
|
51
51
|
getSchema: () => {
|
|
@@ -55,7 +55,7 @@ export default (funcParams: funcParamsProps) => {
|
|
|
55
55
|
localStorage.removeItem("pageFormdata")
|
|
56
56
|
store.navigate("/PageMasterRecords");
|
|
57
57
|
},
|
|
58
|
-
onAddClickHandler:
|
|
58
|
+
onAddClickHandler: function () {
|
|
59
59
|
const id = store.searchParams?.get("id");
|
|
60
60
|
if (!Array.isArray(store.formData.elements)) {
|
|
61
61
|
store.formData.elements = []
|
|
@@ -66,7 +66,9 @@ export default (funcParams: funcParamsProps) => {
|
|
|
66
66
|
);
|
|
67
67
|
},
|
|
68
68
|
savePageHandler: async () => {
|
|
69
|
-
|
|
69
|
+
saveFormdataInLocalStorage(store.ctx.core.data);
|
|
70
|
+
const config = localStorage.getItem("pageFormdata");
|
|
71
|
+
const isSubmitted = await saveHandler(store, service, submitHandler,config);
|
|
70
72
|
if (isSubmitted) {
|
|
71
73
|
localStorage.removeItem("pageFormdata");
|
|
72
74
|
store.navigate('/PageMasterRecords');
|
|
@@ -84,7 +86,7 @@ export default (funcParams: funcParamsProps) => {
|
|
|
84
86
|
},
|
|
85
87
|
Edit_Components: Component(store, dynamicData, submitHandler, service).editComponents,
|
|
86
88
|
Delete_Components: Component(store, dynamicData, submitHandler, service).deleteComponents,
|
|
87
|
-
eventAddHandler:
|
|
89
|
+
eventAddHandler: function () {
|
|
88
90
|
const id = store.searchParams?.get("id");
|
|
89
91
|
if (!Array.isArray(store.formData.events)) {
|
|
90
92
|
store.formData.events = []
|
|
@@ -93,14 +95,14 @@ export default (funcParams: funcParamsProps) => {
|
|
|
93
95
|
const finalPath = `events[${store.formData.events.length}]`
|
|
94
96
|
store.navigate(`/ComponentEvents?path=${finalPath}&id=${id}`)
|
|
95
97
|
},
|
|
96
|
-
editEvent:
|
|
98
|
+
editEvent: function () {
|
|
97
99
|
const rowId = dynamicData.path.split(".")[1];
|
|
98
100
|
const id = store.searchParams?.get("id");
|
|
99
101
|
saveFormdataInLocalStorage(store.ctx.core.data)
|
|
100
102
|
const finalPath = `events[${rowId}]`
|
|
101
103
|
store.navigate(`/ComponentEvents?path=${finalPath}&id=${id}`)
|
|
102
104
|
},
|
|
103
|
-
deleteEvent:
|
|
105
|
+
deleteEvent: function () {
|
|
104
106
|
const rowId = dynamicData.path.split(".")[1];
|
|
105
107
|
store.formData.events.splice(rowId, 1);
|
|
106
108
|
const response = saveFormdataInLocalStorage(store.ctx.core.data)
|