impaktapps-ui-builder 0.0.963-copyElement.1001 → 0.0.963-copyElement.1003

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.
@@ -42,9 +42,6 @@ const PageMasterSchema = {
42
42
  },
43
43
  RemoveItemButton: {
44
44
  disabled: true
45
- },
46
- Paste_Icon: {
47
- disabled: true
48
45
  }
49
46
  },
50
47
  required: ["template", "name", "label"]
@@ -6548,9 +6545,6 @@ const ComponentSchema = {
6548
6545
  label: { type: "string" },
6549
6546
  RemoveItemButton: {
6550
6547
  disabled: true
6551
- },
6552
- Paste_Icon: {
6553
- disabled: true
6554
6548
  }
6555
6549
  },
6556
6550
  required: ["name"]
@@ -8432,35 +8426,36 @@ var Component = (store2, dynamicData2, submitHandler, service2) => {
8432
8426
  sessionStorage.setItem("rowId", rowId);
8433
8427
  store2.updateDialog("popUpEventSection");
8434
8428
  },
8435
- CopyComponent: function(store22) {
8429
+ CopyComponent: function(paramStore) {
8436
8430
  var _a;
8437
8431
  if (sessionStorage.getItem("copiedConfig")) {
8438
- store22.setNotify({
8432
+ store2.setNotify({
8439
8433
  FailMessage: "Element already copied. Cancel to copy again.",
8440
8434
  Fail: true
8441
8435
  });
8442
8436
  } else {
8443
- const schema2 = lodash.exports.cloneDeep(store22.schema);
8444
- const uiSchema = lodash.exports.cloneDeep(store22.uiSchema);
8437
+ const schema2 = lodash.exports.cloneDeep(paramStore.schema || store2.schema);
8438
+ const uiSchema = lodash.exports.cloneDeep(paramStore.uiSchema || store2.uiSchema);
8445
8439
  schema2.properties.RemoveItemButton.disabled = false;
8446
8440
  const rowId = dynamicData2.path.split(".")[1];
8447
- const parentPathOfCopiedComponent = (_a = store22.searchParams) == null ? void 0 : _a.get("path");
8441
+ const parentPathOfCopiedComponent = (_a = store2.searchParams) == null ? void 0 : _a.get("path");
8448
8442
  const copiedComponentPath = parentPathOfCopiedComponent ? `${parentPathOfCopiedComponent}.elements[${rowId}]` : `elements[${rowId}]`;
8449
8443
  const formData = getFormdataFromSessionStorage(copiedComponentPath);
8450
8444
  uiSchema.elements[4].config.main.heading = `Copied Element: ${formData.name}`;
8451
8445
  sessionStorage.setItem("copiedConfig", JSON.stringify(formData));
8452
- store22.setSchema(schema2);
8446
+ store2.setSchema(schema2);
8447
+ store2.setUiSchema(uiSchema);
8453
8448
  }
8454
8449
  },
8455
- PasteComponent: function(store22) {
8450
+ PasteComponent: function(paramStore) {
8456
8451
  var _a;
8457
- const path = (_a = store22.searchParams) == null ? void 0 : _a.get("path");
8452
+ const path = (_a = store2.searchParams) == null ? void 0 : _a.get("path");
8458
8453
  const formData = getFormdataFromSessionStorage(path);
8459
8454
  const insertComponentPath = formData.elements.length;
8460
8455
  const finalPath = `${path}.elements[${insertComponentPath}]`;
8461
8456
  const copiedData = JSON.parse(sessionStorage.getItem("copiedConfig"));
8462
8457
  if (!copiedData.elements) {
8463
- store22.setNotify({
8458
+ store2.setNotify({
8464
8459
  FailMessage: "Pasting element not Valid",
8465
8460
  Fail: true
8466
8461
  });
@@ -8470,6 +8465,13 @@ var Component = (store2, dynamicData2, submitHandler, service2) => {
8470
8465
  this.setPage();
8471
8466
  }
8472
8467
  },
8468
+ RemoveItemButton: function(paramStore) {
8469
+ const schema2 = lodash.exports.cloneDeep(paramStore.schema || store2.schema);
8470
+ const uiSchema = lodash.exports.cloneDeep(paramStore.uiSchema || store2.uiSchema);
8471
+ schema2.properties.RemoveItemButton.disabled = true;
8472
+ store2.setSchema(schema2);
8473
+ store2.setUiSchema(uiSchema);
8474
+ },
8473
8475
  CopyEvent: function(store22) {
8474
8476
  var _a;
8475
8477
  const rowId = dynamicData2.path.split(".")[1];
@@ -8601,6 +8603,7 @@ var pageMaster = (funcParams) => {
8601
8603
  Component(store2, dynamicData2, submitHandler, service2).PasteComponent(store2);
8602
8604
  },
8603
8605
  RemoveItemButton: function() {
8606
+ Component(store2, dynamicData2, submitHandler, service2).RemoveItemButton(store2);
8604
8607
  },
8605
8608
  CopyEvent: function() {
8606
8609
  Component(store2, dynamicData2, submitHandler, service2).CopyEvent(store2);