impaktapps-ui-builder 0.0.340 → 0.0.342
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 +24 -18
- package/dist/impaktapps-ui-builder.es.js.map +1 -1
- package/dist/impaktapps-ui-builder.umd.js +7 -7
- package/dist/impaktapps-ui-builder.umd.js.map +1 -1
- package/dist/src/impaktapps-ui-builder/builder/services/pageMaster.d.ts +1 -1
- package/package.json +1 -1
- package/src/impaktapps-ui-builder/builder/services/component.ts +10 -8
- package/src/impaktapps-ui-builder/builder/services/event.ts +5 -3
- package/src/impaktapps-ui-builder/builder/services/pageMaster.ts +9 -7
|
@@ -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;
|
package/package.json
CHANGED
|
@@ -81,7 +81,7 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
|
|
|
81
81
|
const path = store.searchParams?.get("path");
|
|
82
82
|
console.log(store.ctx.core.errors)
|
|
83
83
|
if (_.isEmpty(store.ctx.core.errors)) {
|
|
84
|
-
saveFormdataInLocalStorage(store.
|
|
84
|
+
saveFormdataInLocalStorage(store.ctx.core.data,path)
|
|
85
85
|
store.navigate(-1)
|
|
86
86
|
store.setNotify({
|
|
87
87
|
SuccessMessage: "Save Successfully",
|
|
@@ -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}`);
|
|
@@ -126,7 +128,7 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
|
|
|
126
128
|
const rowId = dynamicData.path.split(".")[1];
|
|
127
129
|
const path = store.searchParams?.get("path");
|
|
128
130
|
const id = store.searchParams?.get("id");
|
|
129
|
-
saveFormdataInLocalStorage(store.
|
|
131
|
+
saveFormdataInLocalStorage(store.ctx.core.data, path)
|
|
130
132
|
if (path) {
|
|
131
133
|
const path = store.searchParams?.get("path");
|
|
132
134
|
const finalPath = `${path}.elements[${rowId}]`
|
|
@@ -141,7 +143,7 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
|
|
|
141
143
|
const path = store.searchParams?.get("path");
|
|
142
144
|
const rowId = dynamicData.path.split(".")[1];
|
|
143
145
|
store.formData.elements.splice(rowId, 1);
|
|
144
|
-
const response = saveFormdataInLocalStorage(store.
|
|
146
|
+
const response = saveFormdataInLocalStorage(store.ctx.core.data, path)
|
|
145
147
|
const data = path ? _.get(response, path) : response;
|
|
146
148
|
store.setFormdata(data);
|
|
147
149
|
},
|
|
@@ -149,7 +151,7 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
|
|
|
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
|
-
const response = saveFormdataInLocalStorage(store.
|
|
154
|
+
const response = saveFormdataInLocalStorage(store.ctx.core.data, path)
|
|
153
155
|
store.setFormdata(_.get(response, path));
|
|
154
156
|
},
|
|
155
157
|
widgetAddClickHandler: async function () {
|
|
@@ -157,7 +159,7 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
|
|
|
157
159
|
store.formData.elements = []
|
|
158
160
|
}
|
|
159
161
|
const path = store.searchParams?.get("path");
|
|
160
|
-
saveFormdataInLocalStorage(store.
|
|
162
|
+
saveFormdataInLocalStorage(store.ctx.core.data, path)
|
|
161
163
|
const finalPath = `${path}.elements[${store.formData.elements.length}]`
|
|
162
164
|
store.searchParams.set("path", finalPath)
|
|
163
165
|
store.setSearchParams(store.searchParams)
|
|
@@ -168,7 +170,7 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
|
|
|
168
170
|
const rowId = dynamicData.path.split(".")[1];
|
|
169
171
|
const path = store.searchParams?.get("path");
|
|
170
172
|
const id = store.searchParams?.get("id");
|
|
171
|
-
saveFormdataInLocalStorage(store.
|
|
173
|
+
saveFormdataInLocalStorage(store.ctx.core.data, path)
|
|
172
174
|
const finalPath = `${path}.events[${rowId}]`
|
|
173
175
|
store.navigate(`/ComponentEvents?path=${finalPath}&id=${id}`)
|
|
174
176
|
},
|
|
@@ -178,7 +180,7 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
|
|
|
178
180
|
if (!Array.isArray(store.formData.events)) {
|
|
179
181
|
store.formData.events = []
|
|
180
182
|
}
|
|
181
|
-
saveFormdataInLocalStorage(store.
|
|
183
|
+
saveFormdataInLocalStorage(store.ctx.core.data, path)
|
|
182
184
|
const finalPath = `${path}.events[${store.formData.events.length}]`
|
|
183
185
|
store.navigate(`/ComponentEvents?path=${finalPath}&id=${id}`)
|
|
184
186
|
},
|
|
@@ -60,7 +60,9 @@ export default (
|
|
|
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}`);
|
|
@@ -92,7 +94,7 @@ export default (
|
|
|
92
94
|
if (!Array.isArray(store.formData.events)) {
|
|
93
95
|
store.formData.events = []
|
|
94
96
|
}
|
|
95
|
-
saveFormdataInLocalStorage(store.
|
|
97
|
+
saveFormdataInLocalStorage(store.ctx.core.data, path)
|
|
96
98
|
const finalPath = `${path}.events[${store.formData?.events?.length}]`
|
|
97
99
|
store.searchParams.set("path", finalPath)
|
|
98
100
|
store.setSearchParams(store.searchParams)
|
|
@@ -101,7 +103,7 @@ export default (
|
|
|
101
103
|
editEvent: async function () {
|
|
102
104
|
const rowId = dynamicData.path.split(".")[1];
|
|
103
105
|
const path = store.searchParams?.get("path");
|
|
104
|
-
saveFormdataInLocalStorage(store.
|
|
106
|
+
saveFormdataInLocalStorage(store.ctx.core.data, path)
|
|
105
107
|
const finalPath = `${path}.events[${rowId}]`
|
|
106
108
|
store.searchParams.set("path", finalPath)
|
|
107
109
|
store.setSearchParams(store.searchParams)
|
|
@@ -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;
|
|
@@ -60,13 +60,15 @@ export default (funcParams: funcParamsProps) => {
|
|
|
60
60
|
if (!Array.isArray(store.formData.elements)) {
|
|
61
61
|
store.formData.elements = []
|
|
62
62
|
}
|
|
63
|
-
const response = saveFormdataInLocalStorage(store.
|
|
63
|
+
const response = saveFormdataInLocalStorage(store.ctx.core.data)
|
|
64
64
|
store.navigate(
|
|
65
65
|
`/Component?path=${`elements[${response?.elements.length}]`}&id=${id}`
|
|
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');
|
|
@@ -89,21 +91,21 @@ export default (funcParams: funcParamsProps) => {
|
|
|
89
91
|
if (!Array.isArray(store.formData.events)) {
|
|
90
92
|
store.formData.events = []
|
|
91
93
|
}
|
|
92
|
-
saveFormdataInLocalStorage(store.
|
|
94
|
+
saveFormdataInLocalStorage(store.ctx.core.data)
|
|
93
95
|
const finalPath = `events[${store.formData.events.length}]`
|
|
94
96
|
store.navigate(`/ComponentEvents?path=${finalPath}&id=${id}`)
|
|
95
97
|
},
|
|
96
98
|
editEvent: async function () {
|
|
97
99
|
const rowId = dynamicData.path.split(".")[1];
|
|
98
100
|
const id = store.searchParams?.get("id");
|
|
99
|
-
saveFormdataInLocalStorage(store.
|
|
101
|
+
saveFormdataInLocalStorage(store.ctx.core.data)
|
|
100
102
|
const finalPath = `events[${rowId}]`
|
|
101
103
|
store.navigate(`/ComponentEvents?path=${finalPath}&id=${id}`)
|
|
102
104
|
},
|
|
103
105
|
deleteEvent: async function () {
|
|
104
106
|
const rowId = dynamicData.path.split(".")[1];
|
|
105
107
|
store.formData.events.splice(rowId, 1);
|
|
106
|
-
const response = saveFormdataInLocalStorage(store.
|
|
108
|
+
const response = saveFormdataInLocalStorage(store.ctx.core.data)
|
|
107
109
|
store.setFormdata(response);
|
|
108
110
|
},
|
|
109
111
|
}
|