impaktapps-ui-builder 0.0.592-alpha.1 → 0.0.592-alpha.2
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 +46 -46
- package/dist/impaktapps-ui-builder.es.js.map +1 -1
- package/dist/impaktapps-ui-builder.umd.js +16 -16
- package/dist/impaktapps-ui-builder.umd.js.map +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/buildSchema.ts +1 -1
- package/src/impaktapps-ui-builder/builder/services/component.ts +15 -22
- package/src/impaktapps-ui-builder/builder/services/event.ts +4 -4
- 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 +4 -3
|
@@ -7846,8 +7846,8 @@ const flatObjectValueInArray = (config = []) => {
|
|
|
7846
7846
|
});
|
|
7847
7847
|
return data;
|
|
7848
7848
|
};
|
|
7849
|
-
const
|
|
7850
|
-
|
|
7849
|
+
const clearFromSessionStorage = () => {
|
|
7850
|
+
sessionStorage.removeItem("pageFormdata");
|
|
7851
7851
|
};
|
|
7852
7852
|
const getNavigationHistory = (config, path) => {
|
|
7853
7853
|
if (path) {
|
|
@@ -7873,19 +7873,19 @@ const getNavigationHistory = (config, path) => {
|
|
|
7873
7873
|
}
|
|
7874
7874
|
return void 0;
|
|
7875
7875
|
};
|
|
7876
|
-
const
|
|
7876
|
+
const saveFormdataInSessionStorage = (formData, path) => {
|
|
7877
7877
|
let updatedFormdata;
|
|
7878
7878
|
if (path) {
|
|
7879
|
-
const pageFormdata =
|
|
7879
|
+
const pageFormdata = getFormdataFromSessionStorage();
|
|
7880
7880
|
updatedFormdata = _.set(pageFormdata, path, buildConfig(formData));
|
|
7881
7881
|
} else {
|
|
7882
7882
|
updatedFormdata = buildConfig(formData);
|
|
7883
7883
|
}
|
|
7884
|
-
|
|
7884
|
+
sessionStorage.setItem("pageFormdata", JSON.stringify(updatedFormdata));
|
|
7885
7885
|
return updatedFormdata;
|
|
7886
7886
|
};
|
|
7887
|
-
const
|
|
7888
|
-
const pageFormdata =
|
|
7887
|
+
const getFormdataFromSessionStorage = (path) => {
|
|
7888
|
+
const pageFormdata = sessionStorage.getItem("pageFormdata") ? JSON.parse(sessionStorage.getItem("pageFormdata")) : void 0;
|
|
7889
7889
|
let returnValue;
|
|
7890
7890
|
if (path) {
|
|
7891
7891
|
returnValue = _.get(pageFormdata, path);
|
|
@@ -7900,8 +7900,8 @@ async function saveHandler(store2, service2, submitHandler, pageName) {
|
|
|
7900
7900
|
var _a, _b;
|
|
7901
7901
|
(_a = store2.searchParams) == null ? void 0 : _a.get("id");
|
|
7902
7902
|
const path = (_b = store2.searchParams) == null ? void 0 : _b.get("path");
|
|
7903
|
-
|
|
7904
|
-
const config = JSON.parse(
|
|
7903
|
+
saveFormdataInSessionStorage(store2.ctx.core.data, path);
|
|
7904
|
+
const config = JSON.parse(sessionStorage.getItem("pageFormdata"));
|
|
7905
7905
|
if (_.isEmpty(store2.ctx.core.errors)) {
|
|
7906
7906
|
try {
|
|
7907
7907
|
const saveReturn = await submitHandler(store2, service2, config);
|
|
@@ -7913,7 +7913,7 @@ async function saveHandler(store2, service2, submitHandler, pageName) {
|
|
|
7913
7913
|
}
|
|
7914
7914
|
const navigateHandler = (store2, isSubmitted, pageName) => {
|
|
7915
7915
|
if (isSubmitted) {
|
|
7916
|
-
|
|
7916
|
+
sessionStorage.removeItem("pageFormdata");
|
|
7917
7917
|
store2.navigate(pageName || -1);
|
|
7918
7918
|
store2.setNotify({
|
|
7919
7919
|
SuccessMessage: "Submit Successfully",
|
|
@@ -7931,7 +7931,7 @@ function okHandler(store2) {
|
|
|
7931
7931
|
var _a;
|
|
7932
7932
|
const path = (_a = store2.searchParams) == null ? void 0 : _a.get("path");
|
|
7933
7933
|
if (_.isEmpty(store2.ctx.core.errors)) {
|
|
7934
|
-
|
|
7934
|
+
saveFormdataInSessionStorage(store2.ctx.core.data, path);
|
|
7935
7935
|
store2.navigate(-1);
|
|
7936
7936
|
store2.setNotify({
|
|
7937
7937
|
SuccessMessage: "Save Successfully",
|
|
@@ -8008,7 +8008,7 @@ var Component = (store2, dynamicData2, submitHandler, service2) => {
|
|
|
8008
8008
|
getFormdata: function() {
|
|
8009
8009
|
var _a;
|
|
8010
8010
|
const path = (_a = store2.searchParams) == null ? void 0 : _a.get("path");
|
|
8011
|
-
return
|
|
8011
|
+
return getFormdataFromSessionStorage(path);
|
|
8012
8012
|
},
|
|
8013
8013
|
getSchema: function() {
|
|
8014
8014
|
return ComponentSchema;
|
|
@@ -8026,7 +8026,7 @@ var Component = (store2, dynamicData2, submitHandler, service2) => {
|
|
|
8026
8026
|
const rowId = dynamicData2.path.split(".")[1];
|
|
8027
8027
|
const path = (_a = store2.searchParams) == null ? void 0 : _a.get("path");
|
|
8028
8028
|
const id = (_b = store2.searchParams) == null ? void 0 : _b.get("id");
|
|
8029
|
-
|
|
8029
|
+
saveFormdataInSessionStorage(store2.ctx.core.data, path);
|
|
8030
8030
|
if (path) {
|
|
8031
8031
|
const path2 = (_c = store2.searchParams) == null ? void 0 : _c.get("path");
|
|
8032
8032
|
const finalPath = `${path2}.elements[${rowId}]`;
|
|
@@ -8040,27 +8040,27 @@ var Component = (store2, dynamicData2, submitHandler, service2) => {
|
|
|
8040
8040
|
deleteComponents: function(shouldUpdateDialog = true) {
|
|
8041
8041
|
var _a;
|
|
8042
8042
|
const path = (_a = store2.searchParams) == null ? void 0 : _a.get("path");
|
|
8043
|
-
const rowId =
|
|
8043
|
+
const rowId = sessionStorage.getItem("rowId");
|
|
8044
8044
|
store2.formData.elements.splice(rowId, 1);
|
|
8045
|
-
const response =
|
|
8045
|
+
const response = saveFormdataInSessionStorage(store2.ctx.core.data, path);
|
|
8046
8046
|
const data = path ? _.get(response, path) : response;
|
|
8047
8047
|
store2.setFormdata(data);
|
|
8048
8048
|
if (shouldUpdateDialog) {
|
|
8049
8049
|
store2.updateDialog("popUpComponentSection");
|
|
8050
8050
|
}
|
|
8051
|
-
|
|
8051
|
+
sessionStorage.removeItem("rowId");
|
|
8052
8052
|
},
|
|
8053
8053
|
deleteEvent: function(shouldUpdateDialog = true) {
|
|
8054
8054
|
var _a;
|
|
8055
8055
|
const path = (_a = store2.searchParams) == null ? void 0 : _a.get("path");
|
|
8056
|
-
const rowId =
|
|
8056
|
+
const rowId = sessionStorage.getItem("rowId");
|
|
8057
8057
|
store2.formData.events.splice(rowId, 1);
|
|
8058
|
-
const response =
|
|
8058
|
+
const response = saveFormdataInSessionStorage(store2.ctx.core.data, path);
|
|
8059
8059
|
store2.setFormdata(_.get(response, path));
|
|
8060
8060
|
if (shouldUpdateDialog) {
|
|
8061
8061
|
store2.updateDialog("popUpEventSection");
|
|
8062
8062
|
}
|
|
8063
|
-
|
|
8063
|
+
sessionStorage.removeItem("rowId");
|
|
8064
8064
|
},
|
|
8065
8065
|
widgetAddClickHandler: function() {
|
|
8066
8066
|
var _a;
|
|
@@ -8068,7 +8068,7 @@ var Component = (store2, dynamicData2, submitHandler, service2) => {
|
|
|
8068
8068
|
store2.formData.elements = [];
|
|
8069
8069
|
}
|
|
8070
8070
|
const path = (_a = store2.searchParams) == null ? void 0 : _a.get("path");
|
|
8071
|
-
|
|
8071
|
+
saveFormdataInSessionStorage(store2.ctx.core.data, path);
|
|
8072
8072
|
const finalPath = `${path}.elements[${store2.formData.elements.length}]`;
|
|
8073
8073
|
store2.searchParams.set("path", finalPath);
|
|
8074
8074
|
store2.setSearchParams(store2.searchParams);
|
|
@@ -8079,7 +8079,7 @@ var Component = (store2, dynamicData2, submitHandler, service2) => {
|
|
|
8079
8079
|
const rowId = dynamicData2.path.split(".")[1];
|
|
8080
8080
|
const path = (_a = store2.searchParams) == null ? void 0 : _a.get("path");
|
|
8081
8081
|
const id = (_b = store2.searchParams) == null ? void 0 : _b.get("id");
|
|
8082
|
-
|
|
8082
|
+
saveFormdataInSessionStorage(store2.ctx.core.data, path);
|
|
8083
8083
|
const finalPath = `${path}.events[${rowId}]`;
|
|
8084
8084
|
store2.navigate(`/ComponentEvents?path=${finalPath}&id=${id}`);
|
|
8085
8085
|
},
|
|
@@ -8090,7 +8090,7 @@ var Component = (store2, dynamicData2, submitHandler, service2) => {
|
|
|
8090
8090
|
if (!Array.isArray(store2.formData.events)) {
|
|
8091
8091
|
store2.formData.events = [];
|
|
8092
8092
|
}
|
|
8093
|
-
|
|
8093
|
+
saveFormdataInSessionStorage(store2.ctx.core.data, path);
|
|
8094
8094
|
const finalPath = `${path}.events[${store2.formData.events.length}]`;
|
|
8095
8095
|
store2.navigate(`/ComponentEvents?path=${finalPath}&id=${id}`);
|
|
8096
8096
|
},
|
|
@@ -8099,12 +8099,12 @@ var Component = (store2, dynamicData2, submitHandler, service2) => {
|
|
|
8099
8099
|
},
|
|
8100
8100
|
deletePopUpComponent: function() {
|
|
8101
8101
|
const rowId = dynamicData2.path.split(".")[1];
|
|
8102
|
-
|
|
8102
|
+
sessionStorage.setItem("rowId", rowId);
|
|
8103
8103
|
store2.updateDialog("popUpComponentSection");
|
|
8104
8104
|
},
|
|
8105
8105
|
deletePopUpEvent: function() {
|
|
8106
8106
|
const rowId = dynamicData2.path.split(".")[1];
|
|
8107
|
-
|
|
8107
|
+
sessionStorage.setItem("rowId", rowId);
|
|
8108
8108
|
store2.updateDialog("popUpEventSection");
|
|
8109
8109
|
}
|
|
8110
8110
|
};
|
|
@@ -8124,11 +8124,11 @@ var pageMaster = (funcParams) => {
|
|
|
8124
8124
|
var _a;
|
|
8125
8125
|
const id = (_a = store2.searchParams) == null ? void 0 : _a.get("id");
|
|
8126
8126
|
const config = await funcParams.pageConfigProvider(id);
|
|
8127
|
-
const formData =
|
|
8127
|
+
const formData = getFormdataFromSessionStorage();
|
|
8128
8128
|
if (formData) {
|
|
8129
8129
|
return formData;
|
|
8130
8130
|
}
|
|
8131
|
-
|
|
8131
|
+
saveFormdataInSessionStorage(config);
|
|
8132
8132
|
return config;
|
|
8133
8133
|
},
|
|
8134
8134
|
getUiSchema: function() {
|
|
@@ -8138,7 +8138,7 @@ var pageMaster = (funcParams) => {
|
|
|
8138
8138
|
return PageMasterSchema;
|
|
8139
8139
|
},
|
|
8140
8140
|
backHandler: () => {
|
|
8141
|
-
|
|
8141
|
+
sessionStorage.removeItem("pageFormdata");
|
|
8142
8142
|
store2.navigate("/PageMasterRecords");
|
|
8143
8143
|
},
|
|
8144
8144
|
onAddClickHandler: function() {
|
|
@@ -8147,7 +8147,7 @@ var pageMaster = (funcParams) => {
|
|
|
8147
8147
|
if (!Array.isArray(store2.formData.elements)) {
|
|
8148
8148
|
store2.formData.elements = [];
|
|
8149
8149
|
}
|
|
8150
|
-
const response =
|
|
8150
|
+
const response = saveFormdataInSessionStorage(store2.ctx.core.data);
|
|
8151
8151
|
if (id) {
|
|
8152
8152
|
store2.navigate(
|
|
8153
8153
|
`/Component?path=${`elements[${response == null ? void 0 : response.elements.length}]`}&id=${id}`
|
|
@@ -8170,7 +8170,7 @@ var pageMaster = (funcParams) => {
|
|
|
8170
8170
|
if (!Array.isArray(store2.formData.events)) {
|
|
8171
8171
|
store2.formData.events = [];
|
|
8172
8172
|
}
|
|
8173
|
-
|
|
8173
|
+
saveFormdataInSessionStorage(store2.ctx.core.data);
|
|
8174
8174
|
const finalPath = `events[${store2.formData.events.length}]`;
|
|
8175
8175
|
store2.navigate(`/ComponentEvents?path=${finalPath}&id=${id}`);
|
|
8176
8176
|
},
|
|
@@ -8178,26 +8178,26 @@ var pageMaster = (funcParams) => {
|
|
|
8178
8178
|
var _a;
|
|
8179
8179
|
const rowId = dynamicData2.path.split(".")[1];
|
|
8180
8180
|
const id = (_a = store2.searchParams) == null ? void 0 : _a.get("id");
|
|
8181
|
-
|
|
8181
|
+
saveFormdataInSessionStorage(store2.ctx.core.data);
|
|
8182
8182
|
const finalPath = `events[${rowId}]`;
|
|
8183
8183
|
store2.navigate(`/ComponentEvents?path=${finalPath}&id=${id}`);
|
|
8184
8184
|
},
|
|
8185
8185
|
deleteEvent: function() {
|
|
8186
|
-
const rowId =
|
|
8186
|
+
const rowId = sessionStorage.getItem("rowId");
|
|
8187
8187
|
store2.formData.events.splice(rowId, 1);
|
|
8188
|
-
const response =
|
|
8188
|
+
const response = saveFormdataInSessionStorage(store2.ctx.core.data);
|
|
8189
8189
|
store2.setFormdata(response);
|
|
8190
8190
|
store2.updateDialog("popUpPageMasterEvent");
|
|
8191
|
-
|
|
8191
|
+
sessionStorage.removeItem("rowId");
|
|
8192
8192
|
},
|
|
8193
8193
|
deletePopUpComponent: function() {
|
|
8194
8194
|
const rowId = dynamicData2.path.split(".")[1];
|
|
8195
|
-
|
|
8195
|
+
sessionStorage.setItem("rowId", rowId);
|
|
8196
8196
|
store2.updateDialog("popUpPageMasterComponent");
|
|
8197
8197
|
},
|
|
8198
8198
|
deletePopUpEvent: function() {
|
|
8199
8199
|
const rowId = dynamicData2.path.split(".")[1];
|
|
8200
|
-
|
|
8200
|
+
sessionStorage.setItem("rowId", rowId);
|
|
8201
8201
|
store2.updateDialog("popUpPageMasterEvent");
|
|
8202
8202
|
}
|
|
8203
8203
|
};
|
|
@@ -9015,7 +9015,7 @@ var event = (store2, dynamicData2, submitHandler, service2, functionsName) => {
|
|
|
9015
9015
|
if (!Array.isArray(store2.formData.events)) {
|
|
9016
9016
|
store2.formData.events = [];
|
|
9017
9017
|
}
|
|
9018
|
-
|
|
9018
|
+
saveFormdataInSessionStorage(store2.ctx.core.data, path);
|
|
9019
9019
|
const finalPath = `${path}.events[${(_c = (_b = store2.formData) == null ? void 0 : _b.events) == null ? void 0 : _c.length}]`;
|
|
9020
9020
|
store2.searchParams.set("path", finalPath);
|
|
9021
9021
|
store2.setSearchParams(store2.searchParams);
|
|
@@ -9025,7 +9025,7 @@ var event = (store2, dynamicData2, submitHandler, service2, functionsName) => {
|
|
|
9025
9025
|
var _a;
|
|
9026
9026
|
const rowId = dynamicData2.path.split(".")[1];
|
|
9027
9027
|
const path = (_a = store2.searchParams) == null ? void 0 : _a.get("path");
|
|
9028
|
-
|
|
9028
|
+
saveFormdataInSessionStorage(store2.ctx.core.data, path);
|
|
9029
9029
|
const finalPath = `${path}.events[${rowId}]`;
|
|
9030
9030
|
store2.searchParams.set("path", finalPath);
|
|
9031
9031
|
store2.setSearchParams(store2.searchParams);
|
|
@@ -9040,7 +9040,7 @@ var event = (store2, dynamicData2, submitHandler, service2, functionsName) => {
|
|
|
9040
9040
|
},
|
|
9041
9041
|
deletePopUpEvent: function() {
|
|
9042
9042
|
const rowId = dynamicData2.path.split(".")[1];
|
|
9043
|
-
|
|
9043
|
+
sessionStorage.setItem("rowId", rowId);
|
|
9044
9044
|
store2.updateDialog("popUpEvent");
|
|
9045
9045
|
}
|
|
9046
9046
|
};
|
|
@@ -9212,7 +9212,7 @@ function executeCustomHandler(params) {
|
|
|
9212
9212
|
return response;
|
|
9213
9213
|
}
|
|
9214
9214
|
}
|
|
9215
|
-
function mergeFormdata(handlerResponse, componentName, eventConfig, store2, service2,
|
|
9215
|
+
function mergeFormdata(handlerResponse, componentName, eventConfig, store2, service2, formDataHolder) {
|
|
9216
9216
|
if (eventConfig.type === "Select" && !(_.isEmpty(handlerResponse == null ? void 0 : handlerResponse.data) && (handlerResponse == null ? void 0 : handlerResponse.data))) {
|
|
9217
9217
|
store2.setSchema((pre) => {
|
|
9218
9218
|
var _a;
|
|
@@ -9256,9 +9256,9 @@ function mergeFormdata(handlerResponse, componentName, eventConfig, store2, serv
|
|
|
9256
9256
|
}
|
|
9257
9257
|
} else {
|
|
9258
9258
|
if (handlerResponse) {
|
|
9259
|
-
|
|
9259
|
+
formDataHolder[componentName] = handlerResponse.data;
|
|
9260
9260
|
store2.setFormdata((pre) => {
|
|
9261
|
-
return { ...pre, ...
|
|
9261
|
+
return { ...pre, ...formDataHolder };
|
|
9262
9262
|
});
|
|
9263
9263
|
}
|
|
9264
9264
|
}
|
|
@@ -9279,7 +9279,7 @@ const buildBodyFormat = (body2, formData, userValue2, store2) => {
|
|
|
9279
9279
|
finalBody[elem.key] = value;
|
|
9280
9280
|
} else if ((_d = elem == null ? void 0 : elem.value) == null ? void 0 : _d.startsWith("$local")) {
|
|
9281
9281
|
const finalpath = elem.value.substring(7);
|
|
9282
|
-
const value = JSON.parse(
|
|
9282
|
+
const value = JSON.parse(sessionStorage.getItem(finalpath) || '""');
|
|
9283
9283
|
finalBody[elem.key] = value;
|
|
9284
9284
|
} else if ((_e = elem == null ? void 0 : elem.value) == null ? void 0 : _e.startsWith("$")) {
|
|
9285
9285
|
const finalpath = elem.value.substring(1);
|
|
@@ -9348,7 +9348,6 @@ const notifyUiSchema = {
|
|
|
9348
9348
|
},
|
|
9349
9349
|
layout: 6
|
|
9350
9350
|
};
|
|
9351
|
-
let formDataHolder = {};
|
|
9352
9351
|
let pageData = false;
|
|
9353
9352
|
const extractEvents = (eventConfig) => {
|
|
9354
9353
|
function extractsConfigEvents(eventConfigObj) {
|
|
@@ -9391,6 +9390,7 @@ const extractEvents = (eventConfig) => {
|
|
|
9391
9390
|
};
|
|
9392
9391
|
var service = (funcParams) => {
|
|
9393
9392
|
eventGroups = {};
|
|
9393
|
+
const formDataHolder = {};
|
|
9394
9394
|
if (pageData) {
|
|
9395
9395
|
if (!lodash.exports.isEmpty(pageData) && typeof pageData === "object") {
|
|
9396
9396
|
eventGroups = extractEvents(pageData == null ? void 0 : pageData.config);
|
|
@@ -9413,12 +9413,12 @@ var service = (funcParams) => {
|
|
|
9413
9413
|
var _a, _b, _c, _d;
|
|
9414
9414
|
funcParams.store.setFormdata({});
|
|
9415
9415
|
funcParams.store.newData = {};
|
|
9416
|
-
const pageBasicDetailString =
|
|
9416
|
+
const pageBasicDetailString = sessionStorage.getItem("pagemasterMetaData");
|
|
9417
9417
|
if (pageBasicDetailString) {
|
|
9418
9418
|
pageData = JSON.parse(pageBasicDetailString);
|
|
9419
9419
|
} else {
|
|
9420
9420
|
pageData = await funcParams.pageDataProvider();
|
|
9421
|
-
|
|
9421
|
+
sessionStorage.setItem("pagemasterMetaData", JSON.stringify({
|
|
9422
9422
|
schema: pageData == null ? void 0 : pageData.schema,
|
|
9423
9423
|
uiSchema: pageData == null ? void 0 : pageData.uiSchema,
|
|
9424
9424
|
config: pageData == null ? void 0 : pageData.config
|
|
@@ -11938,5 +11938,5 @@ const buildUiSchema = (config, store2) => {
|
|
|
11938
11938
|
}
|
|
11939
11939
|
return elements;
|
|
11940
11940
|
};
|
|
11941
|
-
export { buildConfig, buildSchema, buildUiSchema,
|
|
11941
|
+
export { buildConfig, buildSchema, buildUiSchema, clearFromSessionStorage, pageMaster, Component as pageMasterComponents, event as pageMasterEvents, service as pageService, schema };
|
|
11942
11942
|
//# sourceMappingURL=impaktapps-ui-builder.es.js.map
|