impaktapps-ui-builder 0.0.963-CopyComponent.1 → 0.0.963-CopyComponent.3

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.
@@ -7782,6 +7782,44 @@ const TableSection = (theme) => {
7782
7782
  }
7783
7783
  }
7784
7784
  }
7785
+ },
7786
+ {
7787
+ header: "Copy",
7788
+ field: "Copy_Component2",
7789
+ flex: 1,
7790
+ widget: {
7791
+ type: "Control",
7792
+ scope: "#/properties/CopyComponent2",
7793
+ options: {
7794
+ widget: "IconButton"
7795
+ },
7796
+ config: {
7797
+ main: {
7798
+ icon: "FileCopyIcon",
7799
+ onClick: "CopyComponent",
7800
+ tooltipMessage: "Reject This Record"
7801
+ }
7802
+ }
7803
+ }
7804
+ },
7805
+ {
7806
+ header: "paste",
7807
+ field: "Paste_Component2",
7808
+ flex: 1,
7809
+ widget: {
7810
+ type: "Control",
7811
+ scope: "#/properties/PasteComponent2",
7812
+ options: {
7813
+ widget: "IconButton"
7814
+ },
7815
+ config: {
7816
+ main: {
7817
+ icon: "SendIcon",
7818
+ onClick: "PasteComponent",
7819
+ tooltipMessage: "Reject This Record"
7820
+ }
7821
+ }
7822
+ }
7785
7823
  }
7786
7824
  ]
7787
7825
  }
@@ -8203,6 +8241,26 @@ var Component = (store2, dynamicData2, submitHandler, service2) => {
8203
8241
  const rowId = dynamicData2.path.split(".")[1];
8204
8242
  sessionStorage.setItem("rowId", rowId);
8205
8243
  store2.updateDialog("popUpEventSection");
8244
+ },
8245
+ CopyComponent: function() {
8246
+ var _a;
8247
+ const rowId = dynamicData2.path.split(".")[1];
8248
+ const path = (_a = store2.searchParams) == null ? void 0 : _a.get("path");
8249
+ const updatedPath = path ? `${path}.elements[${rowId}]` : `elements[${rowId}]`;
8250
+ const formData = getFormdataFromSessionStorage(updatedPath);
8251
+ sessionStorage.setItem("copiedComponent", JSON.stringify(formData));
8252
+ },
8253
+ PasteComponent: function() {
8254
+ var _a;
8255
+ const path = (_a = store2.searchParams) == null ? void 0 : _a.get("path");
8256
+ const rowId = dynamicData2.path.split(".")[1];
8257
+ const updatedPath = `${path}.elements[${rowId}]`;
8258
+ const formData = getFormdataFromSessionStorage(updatedPath);
8259
+ const insertComponentPath = formData.elements.length;
8260
+ const finalPath = `${updatedPath}.elements[${insertComponentPath}]`;
8261
+ const copiedData = JSON.parse(sessionStorage.getItem("copiedComponent"));
8262
+ saveFormdataInSessionStorage(copiedData, finalPath);
8263
+ sessionStorage.removeItem("copiedComponent");
8206
8264
  }
8207
8265
  };
8208
8266
  };
@@ -8299,11 +8357,12 @@ var pageMaster = (funcParams) => {
8299
8357
  },
8300
8358
  CopyComponent: function() {
8301
8359
  var _a, _b;
8302
- dynamicData2.path.split(".")[1];
8360
+ const rowId = dynamicData2.path.split(".")[1];
8303
8361
  const path = (_a = store2.searchParams) == null ? void 0 : _a.get("path");
8304
8362
  (_b = store2.searchParams) == null ? void 0 : _b.get("id");
8305
- const formData = getFormdataFromSessionStorage(path);
8306
- sessionStorage.setItem("copiedComponent", formData);
8363
+ const updatedPath = path ? `${path}.elements[${rowId}]` : `elements[${rowId}]`;
8364
+ const formData = getFormdataFromSessionStorage(updatedPath);
8365
+ sessionStorage.setItem("copiedComponent", JSON.stringify(formData));
8307
8366
  },
8308
8367
  PasteComponent: function() {
8309
8368
  var _a;
@@ -8313,7 +8372,7 @@ var pageMaster = (funcParams) => {
8313
8372
  const formData = getFormdataFromSessionStorage(updatedPath);
8314
8373
  const insertComponentPath = formData.elements.length;
8315
8374
  const finalPath = `${updatedPath}.elements[${insertComponentPath}]`;
8316
- const copiedData = sessionStorage.getItem("copiedComponent");
8375
+ const copiedData = JSON.parse(sessionStorage.getItem("copiedComponent"));
8317
8376
  saveFormdataInSessionStorage(copiedData, finalPath);
8318
8377
  sessionStorage.removeItem("copiedComponent");
8319
8378
  }