impaktapps-ui-builder 0.0.22 → 0.0.23

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.
@@ -6282,19 +6282,19 @@ const getNavigationHistory = (config, path) => {
6282
6282
  }
6283
6283
  return void 0;
6284
6284
  };
6285
- const saveFormdataInLocalStorage = (formData, path) => {
6285
+ const saveFormdataInSessionStorage = (formData, path) => {
6286
6286
  let updatedFormdata;
6287
6287
  if (path) {
6288
- const pageFormdata = getFormdataFromLocalStorage();
6288
+ const pageFormdata = getFormdataFromSessionStorage();
6289
6289
  updatedFormdata = _.set(pageFormdata, path, buildConfig(formData));
6290
6290
  } else {
6291
6291
  updatedFormdata = buildConfig(formData);
6292
6292
  }
6293
- localStorage.setItem("pageFormdata", JSON.stringify(updatedFormdata));
6293
+ sessionStorage.setItem("pageFormdata", JSON.stringify(updatedFormdata));
6294
6294
  return updatedFormdata;
6295
6295
  };
6296
- const getFormdataFromLocalStorage = (path) => {
6297
- const pageFormdata = localStorage.getItem("pageFormdata") ? JSON.parse(localStorage.getItem("pageFormdata")) : void 0;
6296
+ const getFormdataFromSessionStorage = (path) => {
6297
+ const pageFormdata = sessionStorage.getItem("pageFormdata") ? JSON.parse(sessionStorage.getItem("pageFormdata")) : void 0;
6298
6298
  let returnValue;
6299
6299
  if (path) {
6300
6300
  returnValue = _.get(pageFormdata, path);
@@ -7036,7 +7036,7 @@ var Component = (store2, dynamicData2) => {
7036
7036
  getFormdata: async function() {
7037
7037
  var _a;
7038
7038
  const path = (_a = store2.searchParams) == null ? void 0 : _a.get("path");
7039
- return getFormdataFromLocalStorage(path);
7039
+ return getFormdataFromSessionStorage(path);
7040
7040
  },
7041
7041
  getSchema: function() {
7042
7042
  return ComponentSchema;
@@ -7044,7 +7044,7 @@ var Component = (store2, dynamicData2) => {
7044
7044
  saveHandler: async function() {
7045
7045
  var _a;
7046
7046
  const path = (_a = store2.searchParams) == null ? void 0 : _a.get("path");
7047
- saveFormdataInLocalStorage(store2.formData, path);
7047
+ saveFormdataInSessionStorage(store2.formData, path);
7048
7048
  store2.navigate(-1);
7049
7049
  store2.setNotify({
7050
7050
  SuccessMessage: "Save Successfully",
@@ -7062,7 +7062,7 @@ var Component = (store2, dynamicData2) => {
7062
7062
  const rowId = dynamicData2.path.split(".")[1];
7063
7063
  const path = (_a = store2.searchParams) == null ? void 0 : _a.get("path");
7064
7064
  const id = (_b = store2.searchParams) == null ? void 0 : _b.get("id");
7065
- saveFormdataInLocalStorage(store2.formData, path);
7065
+ saveFormdataInSessionStorage(store2.formData, path);
7066
7066
  if (path) {
7067
7067
  const path2 = (_c = store2.searchParams) == null ? void 0 : _c.get("path");
7068
7068
  const finalPath = `${path2}.elements[${rowId}]`;
@@ -7078,7 +7078,7 @@ var Component = (store2, dynamicData2) => {
7078
7078
  const path = (_a = store2.searchParams) == null ? void 0 : _a.get("path");
7079
7079
  const rowId = dynamicData2.path.split(".")[1];
7080
7080
  store2.formData.elements.splice(rowId, 1);
7081
- const response = saveFormdataInLocalStorage(store2.formData, path);
7081
+ const response = saveFormdataInSessionStorage(store2.formData, path);
7082
7082
  const data2 = path ? _.get(response, path) : response;
7083
7083
  store2.setFormdata(data2);
7084
7084
  },
@@ -7087,7 +7087,7 @@ var Component = (store2, dynamicData2) => {
7087
7087
  const path = (_a = store2.searchParams) == null ? void 0 : _a.get("path");
7088
7088
  const rowId = dynamicData2.path.split(".")[1];
7089
7089
  store2.formData.events.splice(rowId, 1);
7090
- const response = saveFormdataInLocalStorage(store2.formData, path);
7090
+ const response = saveFormdataInSessionStorage(store2.formData, path);
7091
7091
  store2.setFormdata(_.get(response, path));
7092
7092
  },
7093
7093
  widgetAddClickHandler: async function() {
@@ -7096,7 +7096,7 @@ var Component = (store2, dynamicData2) => {
7096
7096
  store2.formData.elements = [];
7097
7097
  }
7098
7098
  const path = (_a = store2.searchParams) == null ? void 0 : _a.get("path");
7099
- saveFormdataInLocalStorage(store2.formData, path);
7099
+ saveFormdataInSessionStorage(store2.formData, path);
7100
7100
  const finalPath = `${path}.elements[${store2.formData.elements.length}]`;
7101
7101
  store2.searchParams.set("path", finalPath);
7102
7102
  store2.setSearchParams(store2.searchParams);
@@ -7107,7 +7107,7 @@ var Component = (store2, dynamicData2) => {
7107
7107
  const rowId = dynamicData2.path.split(".")[1];
7108
7108
  const path = (_a = store2.searchParams) == null ? void 0 : _a.get("path");
7109
7109
  const id = (_b = store2.searchParams) == null ? void 0 : _b.get("id");
7110
- saveFormdataInLocalStorage(store2.formData, path);
7110
+ saveFormdataInSessionStorage(store2.formData, path);
7111
7111
  const finalPath = `${path}.events[${rowId}]`;
7112
7112
  store2.navigate(`/ComponentEvents?path=${finalPath}&id=${id}`);
7113
7113
  },
@@ -7118,7 +7118,7 @@ var Component = (store2, dynamicData2) => {
7118
7118
  if (!Array.isArray(store2.formData.events)) {
7119
7119
  store2.formData.events = [];
7120
7120
  }
7121
- saveFormdataInLocalStorage(store2.formData, path);
7121
+ saveFormdataInSessionStorage(store2.formData, path);
7122
7122
  const finalPath = `${path}.events[${store2.formData.events.length}]`;
7123
7123
  store2.navigate(`/ComponentEvents?path=${finalPath}&id=${id}`);
7124
7124
  },
@@ -7141,11 +7141,11 @@ var pageMaster = (funcParams) => {
7141
7141
  getFormdata: async function() {
7142
7142
  var _a;
7143
7143
  (_a = store2.searchParams) == null ? void 0 : _a.get("id");
7144
- const formData = getFormdataFromLocalStorage();
7144
+ const formData = getFormdataFromSessionStorage();
7145
7145
  if (formData) {
7146
7146
  return formData;
7147
7147
  }
7148
- saveFormdataInLocalStorage(config);
7148
+ saveFormdataInSessionStorage(config);
7149
7149
  return config;
7150
7150
  },
7151
7151
  getUiSchema: async function() {
@@ -7155,7 +7155,7 @@ var pageMaster = (funcParams) => {
7155
7155
  return PageMasterSchema;
7156
7156
  },
7157
7157
  backHandler: () => {
7158
- localStorage.removeItem("pageFormdata");
7158
+ sessionStorage.removeItem("pageFormdata");
7159
7159
  store2.navigate("/PageMasterRecords");
7160
7160
  },
7161
7161
  onAddClickHandler: async function() {
@@ -7164,14 +7164,14 @@ var pageMaster = (funcParams) => {
7164
7164
  if (!Array.isArray(store2.formData.elements)) {
7165
7165
  store2.formData.elements = [];
7166
7166
  }
7167
- const response = saveFormdataInLocalStorage(store2.formData);
7167
+ const response = saveFormdataInSessionStorage(store2.formData);
7168
7168
  store2.navigate(
7169
7169
  `/Component?path=${`elements[${response == null ? void 0 : response.elements.length}]`}&id=${id}`
7170
7170
  );
7171
7171
  },
7172
7172
  submitPageHandler: async function() {
7173
7173
  submitHandler(store2, funcParams.service).then((saveReturn) => {
7174
- localStorage.removeItem("pageFormdata");
7174
+ sessionStorage.removeItem("pageFormdata");
7175
7175
  store2.navigate(-1);
7176
7176
  store2.setNotify({
7177
7177
  SuccessMessage: "Submit Successfully",
@@ -7187,7 +7187,7 @@ var pageMaster = (funcParams) => {
7187
7187
  if (!Array.isArray(store2.formData.events)) {
7188
7188
  store2.formData.events = [];
7189
7189
  }
7190
- saveFormdataInLocalStorage(store2.formData);
7190
+ saveFormdataInSessionStorage(store2.formData);
7191
7191
  const finalPath = `events[${store2.formData.events.length}]`;
7192
7192
  store2.navigate(`/ComponentEvents?path=${finalPath}&id=${id}`);
7193
7193
  },
@@ -7195,14 +7195,14 @@ var pageMaster = (funcParams) => {
7195
7195
  var _a;
7196
7196
  const rowId = dynamicData2.path.split(".")[1];
7197
7197
  const id = (_a = store2.searchParams) == null ? void 0 : _a.get("id");
7198
- saveFormdataInLocalStorage(store2.formData);
7198
+ saveFormdataInSessionStorage(store2.formData);
7199
7199
  const finalPath = `events[${rowId}]`;
7200
7200
  store2.navigate(`/ComponentEvents?path=${finalPath}&id=${id}`);
7201
7201
  },
7202
7202
  deleteEvent: async function() {
7203
7203
  const rowId = dynamicData2.path.split(".")[1];
7204
7204
  store2.formData.events.splice(rowId, 1);
7205
- const response = saveFormdataInLocalStorage(store2.formData);
7205
+ const response = saveFormdataInSessionStorage(store2.formData);
7206
7206
  store2.setFormdata(response);
7207
7207
  }
7208
7208
  };
@@ -7753,7 +7753,7 @@ var event = (store2, dynamicData2) => {
7753
7753
  if (!Array.isArray(store2.formData.events)) {
7754
7754
  store2.formData.events = [];
7755
7755
  }
7756
- saveFormdataInLocalStorage(store2.formData, path);
7756
+ saveFormdataInSessionStorage(store2.formData, path);
7757
7757
  const finalPath = `${path}.events[${(_c = (_b = store2.formData) == null ? void 0 : _b.events) == null ? void 0 : _c.length}]`;
7758
7758
  store2.searchParams.set("path", finalPath);
7759
7759
  store2.setSearchParams(store2.searchParams);
@@ -7763,7 +7763,7 @@ var event = (store2, dynamicData2) => {
7763
7763
  var _a;
7764
7764
  const rowId = dynamicData2.path.split(".")[1];
7765
7765
  const path = (_a = store2.searchParams) == null ? void 0 : _a.get("path");
7766
- saveFormdataInLocalStorage(store2.formData, path);
7766
+ saveFormdataInSessionStorage(store2.formData, path);
7767
7767
  const finalPath = `${path}.events[${rowId}]`;
7768
7768
  store2.searchParams.set("path", finalPath);
7769
7769
  store2.setSearchParams(store2.searchParams);
@@ -10400,5 +10400,8 @@ const buildUiSchema = (config) => {
10400
10400
  }
10401
10401
  return elements;
10402
10402
  };
10403
- export { buildConfig, buildUiSchema, pageMaster, Component as pageMasterComponents, event as pageMasterEvents, service as pageService };
10403
+ var clearSessionStorage = () => {
10404
+ sessionStorage.removeItem("pageFormdata");
10405
+ };
10406
+ export { buildConfig, buildUiSchema, clearSessionStorage, pageMaster, Component as pageMasterComponents, event as pageMasterEvents, service as pageService };
10404
10407
  //# sourceMappingURL=impaktapps-ui-builder.es.js.map