impaktapps-ui-builder 0.0.963-CopyComponent.8 → 0.0.963-copyElement.1000

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.
@@ -39,6 +39,12 @@ const PageMasterSchema = {
39
39
  }
40
40
  }
41
41
  }
42
+ },
43
+ RemoveItemButton: {
44
+ disabled: true
45
+ },
46
+ Paste_Icon: {
47
+ disabled: true
42
48
  }
43
49
  },
44
50
  required: ["template", "name", "label"]
@@ -177,7 +183,7 @@ const PageMasterUiSchema = (theme) => {
177
183
  main: {
178
184
  onClick: "PasteComponent",
179
185
  size: "small",
180
- icon: "SendIcon",
186
+ icon: "PasteIcon",
181
187
  iconLabel: "Paste",
182
188
  styleDefault: true
183
189
  },
@@ -309,7 +315,7 @@ const PageMasterUiSchema = (theme) => {
309
315
  main: {
310
316
  onClick: "PasteEvent",
311
317
  size: "small",
312
- icon: "SendIcon",
318
+ icon: "PasteIcon",
313
319
  iconLabel: "Paste",
314
320
  styleDefault: true
315
321
  },
@@ -401,14 +407,58 @@ const PageMasterUiSchema = (theme) => {
401
407
  ]
402
408
  },
403
409
  {
404
- type: "Control",
405
- scope: "#/properties/btn",
406
- options: {
407
- widget: "EmptyBox"
408
- },
410
+ type: "HorizontalLayout",
409
411
  config: {
410
- layout: { xs: 8, sm: 10 }
411
- }
412
+ layout: { xs: 12, sm: 6 }
413
+ },
414
+ elements: [
415
+ {
416
+ type: "Control",
417
+ scope: "#/properties/RemoveItemButton",
418
+ options: {
419
+ widget: "IconButton"
420
+ },
421
+ config: {
422
+ layout: { xs: 1, sm: 1 },
423
+ main: {
424
+ onClick: "RemoveCopiedConfig",
425
+ size: "large",
426
+ icon: "RejectIcon",
427
+ styleDefault: true
428
+ },
429
+ style: {
430
+ marginLeft: "-10px"
431
+ }
432
+ }
433
+ },
434
+ {
435
+ type: "Control",
436
+ scope: "#/properties/copiedElementDetails",
437
+ options: {
438
+ widget: "Box"
439
+ },
440
+ config: {
441
+ layout: { xs: 6, sm: 6 },
442
+ main: {
443
+ heading: "No element copied"
444
+ },
445
+ style: {
446
+ color: "#a1a09d",
447
+ marginLeft: "-10px"
448
+ }
449
+ }
450
+ },
451
+ {
452
+ type: "Control",
453
+ scope: "#/properties/EmptyBox",
454
+ options: {
455
+ widget: "EmptyBox"
456
+ },
457
+ config: {
458
+ layout: { xs: 1, sm: 5 }
459
+ }
460
+ }
461
+ ]
412
462
  },
413
463
  {
414
464
  type: "Control",
@@ -6495,7 +6545,13 @@ const ComponentSchema = {
6495
6545
  name: {
6496
6546
  type: "string"
6497
6547
  },
6498
- label: { type: "string" }
6548
+ label: { type: "string" },
6549
+ RemoveItemButton: {
6550
+ disabled: true
6551
+ },
6552
+ Paste_Icon: {
6553
+ disabled: true
6554
+ }
6499
6555
  },
6500
6556
  required: ["name"]
6501
6557
  };
@@ -6853,14 +6909,58 @@ const componentBasicUiSchema = (theme) => {
6853
6909
  ]
6854
6910
  },
6855
6911
  {
6856
- type: "Control",
6857
- scope: "#/properties/EmptyBox",
6858
- options: {
6859
- widget: "EmptyBox"
6860
- },
6912
+ type: "HorizontalLayout",
6861
6913
  config: {
6862
- layout: { xs: 4, sm: 8 }
6863
- }
6914
+ layout: { xs: 12, sm: 6 }
6915
+ },
6916
+ elements: [
6917
+ {
6918
+ type: "Control",
6919
+ scope: "#/properties/RemoveItemButton",
6920
+ options: {
6921
+ widget: "IconButton"
6922
+ },
6923
+ config: {
6924
+ layout: { xs: 1, sm: 1 },
6925
+ main: {
6926
+ onClick: "RemoveCopiedConfig",
6927
+ size: "large",
6928
+ icon: "RejectIcon",
6929
+ styleDefault: true
6930
+ },
6931
+ style: {
6932
+ marginLeft: "-10px"
6933
+ }
6934
+ }
6935
+ },
6936
+ {
6937
+ type: "Control",
6938
+ scope: "#/properties/copiedElementDetails",
6939
+ options: {
6940
+ widget: "Box"
6941
+ },
6942
+ config: {
6943
+ layout: { xs: 6, sm: 6 },
6944
+ main: {
6945
+ heading: "No element copied"
6946
+ },
6947
+ style: {
6948
+ color: "#a1a09d",
6949
+ marginLeft: "-10px"
6950
+ }
6951
+ }
6952
+ },
6953
+ {
6954
+ type: "Control",
6955
+ scope: "#/properties/EmptyBox",
6956
+ options: {
6957
+ widget: "EmptyBox"
6958
+ },
6959
+ config: {
6960
+ layout: { xs: 1, sm: 5 }
6961
+ }
6962
+ }
6963
+ ]
6864
6964
  },
6865
6965
  {
6866
6966
  type: "Control",
@@ -7190,7 +7290,7 @@ const EventSection = (theme) => {
7190
7290
  main: {
7191
7291
  onClick: "PasteEvent",
7192
7292
  size: "small",
7193
- icon: "SendIcon",
7293
+ icon: "PasteIcon",
7194
7294
  iconLabel: "Paste",
7195
7295
  styleDefault: true
7196
7296
  },
@@ -7818,7 +7918,7 @@ const TableSection = (theme) => {
7818
7918
  main: {
7819
7919
  onClick: "PasteComponent",
7820
7920
  size: "small",
7821
- icon: "SendIcon",
7921
+ icon: "PasteIcon",
7822
7922
  iconLabel: "Paste",
7823
7923
  styleDefault: true
7824
7924
  },
@@ -7901,7 +8001,8 @@ const TableSection = (theme) => {
7901
8001
  main: {
7902
8002
  icon: "FileCopyIcon",
7903
8003
  onClick: "CopyComponent",
7904
- styleDefault: true
8004
+ styleDefault: true,
8005
+ disabled: false
7905
8006
  }
7906
8007
  }
7907
8008
  }
@@ -8213,6 +8314,10 @@ const refreshPage = (type, store2) => {
8213
8314
  UiSchema.elements[1].config.main.tabLabels = sectionLabels[type] || ["Core", "Style", "Event", "Validation"];
8214
8315
  UiSchema.elements[1].elements = elements || [CoreSection, StyleSection, EventSection(store2.theme.myTheme), ValidationSection];
8215
8316
  }
8317
+ if (sessionStorage.getItem("copiedConfig")) {
8318
+ const formData = JSON.parse(sessionStorage.getItem("copiedConfig"));
8319
+ UiSchema.elements[4].element[1].config.main.heading = `Copied Element: ${formData.name}`;
8320
+ }
8216
8321
  store2.setUiSchema(UiSchema);
8217
8322
  };
8218
8323
  var Component = (store2, dynamicData2, submitHandler, service2) => {
@@ -8327,24 +8432,36 @@ var Component = (store2, dynamicData2, submitHandler, service2) => {
8327
8432
  sessionStorage.setItem("rowId", rowId);
8328
8433
  store2.updateDialog("popUpEventSection");
8329
8434
  },
8330
- CopyComponent: function() {
8435
+ CopyComponent: function(store22) {
8331
8436
  var _a;
8332
- const rowId = dynamicData2.path.split(".")[1];
8333
- const parentPathOfCopiedComponent = (_a = store2.searchParams) == null ? void 0 : _a.get("path");
8334
- const copiedComponentPath = parentPathOfCopiedComponent ? `${parentPathOfCopiedComponent}.elements[${rowId}]` : `elements[${rowId}]`;
8335
- const formData = getFormdataFromSessionStorage(copiedComponentPath);
8336
- sessionStorage.setItem("copiedConfig", JSON.stringify(formData));
8337
- },
8338
- PasteComponent: function() {
8437
+ if (sessionStorage.getItem("copiedConfig")) {
8438
+ store22.setNotify({
8439
+ FailMessage: "Element already copied. Cancel to copy again.",
8440
+ Fail: true
8441
+ });
8442
+ } else {
8443
+ const schema2 = lodash.exports.cloneDeep(store22.schema);
8444
+ const uiSchema = lodash.exports.cloneDeep(store22.uiSchema);
8445
+ schema2.properties.RemoveItemButton.disabled = false;
8446
+ const rowId = dynamicData2.path.split(".")[1];
8447
+ const parentPathOfCopiedComponent = (_a = store22.searchParams) == null ? void 0 : _a.get("path");
8448
+ const copiedComponentPath = parentPathOfCopiedComponent ? `${parentPathOfCopiedComponent}.elements[${rowId}]` : `elements[${rowId}]`;
8449
+ const formData = getFormdataFromSessionStorage(copiedComponentPath);
8450
+ uiSchema.elements[4].config.main.heading = `Copied Element: ${formData.name}`;
8451
+ sessionStorage.setItem("copiedConfig", JSON.stringify(formData));
8452
+ store22.setSchema(schema2);
8453
+ }
8454
+ },
8455
+ PasteComponent: function(store22) {
8339
8456
  var _a;
8340
- const path = (_a = store2.searchParams) == null ? void 0 : _a.get("path");
8457
+ const path = (_a = store22.searchParams) == null ? void 0 : _a.get("path");
8341
8458
  const formData = getFormdataFromSessionStorage(path);
8342
8459
  const insertComponentPath = formData.elements.length;
8343
8460
  const finalPath = `${path}.elements[${insertComponentPath}]`;
8344
8461
  const copiedData = JSON.parse(sessionStorage.getItem("copiedConfig"));
8345
8462
  if (!copiedData.elements) {
8346
- store2.setNotify({
8347
- FailMessage: "Pasting not Valid",
8463
+ store22.setNotify({
8464
+ FailMessage: "Pasting element not Valid",
8348
8465
  Fail: true
8349
8466
  });
8350
8467
  } else {
@@ -8353,23 +8470,23 @@ var Component = (store2, dynamicData2, submitHandler, service2) => {
8353
8470
  this.setPage();
8354
8471
  }
8355
8472
  },
8356
- CopyEvent: function() {
8473
+ CopyEvent: function(store22) {
8357
8474
  var _a;
8358
8475
  const rowId = dynamicData2.path.split(".")[1];
8359
- const path = (_a = store2.searchParams) == null ? void 0 : _a.get("path");
8476
+ const path = (_a = store22.searchParams) == null ? void 0 : _a.get("path");
8360
8477
  const updatedPath = path ? `${path}.events[${rowId}]` : `events[${rowId}]`;
8361
8478
  const formData = getFormdataFromSessionStorage(updatedPath);
8362
8479
  sessionStorage.setItem("copiedConfig", JSON.stringify(formData));
8363
8480
  },
8364
- PasteEvent: function() {
8481
+ PasteEvent: function(store22) {
8365
8482
  var _a;
8366
- const path = (_a = store2.searchParams) == null ? void 0 : _a.get("path");
8483
+ const path = (_a = store22.searchParams) == null ? void 0 : _a.get("path");
8367
8484
  const formData = getFormdataFromSessionStorage(path);
8368
8485
  const insertComponentPath = formData.events.length;
8369
8486
  const finalPath = `${path}.events[${insertComponentPath}]`;
8370
8487
  const copiedData = JSON.parse(sessionStorage.getItem("copiedConfig"));
8371
8488
  if (!copiedData.events) {
8372
- store2.setNotify({
8489
+ store22.setNotify({
8373
8490
  FailMessage: "Pasting not Valid",
8374
8491
  Fail: true
8375
8492
  });
@@ -8404,7 +8521,12 @@ var pageMaster = (funcParams) => {
8404
8521
  return config;
8405
8522
  },
8406
8523
  getUiSchema: function() {
8407
- return PageMasterUiSchema(store2.theme.myTheme);
8524
+ const UiSchema = _.cloneDeep(PageMasterUiSchema(store2.theme.myTheme));
8525
+ if (sessionStorage.getItem("copiedConfig")) {
8526
+ const formData = JSON.parse(sessionStorage.getItem("copiedConfig"));
8527
+ UiSchema.elements[2].element[1].config.main.heading = `Copied Element: ${formData.name}`;
8528
+ }
8529
+ return UiSchema;
8408
8530
  },
8409
8531
  getSchema: () => {
8410
8532
  return PageMasterSchema;
@@ -8472,10 +8594,20 @@ var pageMaster = (funcParams) => {
8472
8594
  sessionStorage.setItem("rowId", rowId);
8473
8595
  store2.updateDialog("popUpPageMasterEvent");
8474
8596
  },
8475
- CopyComponent: Component(store2, dynamicData2, submitHandler, service2).CopyComponent,
8476
- PasteComponent: Component(store2, dynamicData2, submitHandler, service2).PasteComponent,
8477
- CopyEvent: Component(store2, dynamicData2, submitHandler, service2).CopyEvent,
8478
- PasteEvent: Component(store2, dynamicData2, submitHandler, service2).PasteEvent
8597
+ CopyComponent: function() {
8598
+ Component(store2, dynamicData2, submitHandler, service2).CopyComponent(store2);
8599
+ },
8600
+ PasteComponent: function() {
8601
+ Component(store2, dynamicData2, submitHandler, service2).PasteComponent(store2);
8602
+ },
8603
+ RemoveItemButton: function() {
8604
+ },
8605
+ CopyEvent: function() {
8606
+ Component(store2, dynamicData2, submitHandler, service2).CopyEvent(store2);
8607
+ },
8608
+ PasteEvent: function() {
8609
+ Component(store2, dynamicData2, submitHandler, service2).PasteEvent(store2);
8610
+ }
8479
8611
  };
8480
8612
  };
8481
8613
  const EventSchema = {
@@ -8674,7 +8806,7 @@ const EventUiSchema = (theme) => {
8674
8806
  main: {
8675
8807
  onClick: "PasteEvent",
8676
8808
  size: "small",
8677
- icon: "SendIcon",
8809
+ icon: "PasteIcon",
8678
8810
  iconLabel: "Paste",
8679
8811
  styleDefault: true
8680
8812
  },
@@ -8766,14 +8898,58 @@ const EventUiSchema = (theme) => {
8766
8898
  ]
8767
8899
  },
8768
8900
  {
8769
- type: "Control",
8770
- scope: "#/properties/EmptyBox",
8771
- options: {
8772
- widget: "EmptyBox"
8773
- },
8901
+ type: "HorizontalLayout",
8774
8902
  config: {
8775
- layout: { xs: 4, sm: 8 }
8776
- }
8903
+ layout: { xs: 12, sm: 6 }
8904
+ },
8905
+ elements: [
8906
+ {
8907
+ type: "Control",
8908
+ scope: "#/properties/RemoveItemButton",
8909
+ options: {
8910
+ widget: "IconButton"
8911
+ },
8912
+ config: {
8913
+ layout: { xs: 1, sm: 1 },
8914
+ main: {
8915
+ onClick: "RemoveCopiedConfig",
8916
+ size: "large",
8917
+ icon: "RejectIcon",
8918
+ styleDefault: true
8919
+ },
8920
+ style: {
8921
+ marginLeft: "-10px"
8922
+ }
8923
+ }
8924
+ },
8925
+ {
8926
+ type: "Control",
8927
+ scope: "#/properties/copiedElementDetails",
8928
+ options: {
8929
+ widget: "Box"
8930
+ },
8931
+ config: {
8932
+ layout: { xs: 6, sm: 6 },
8933
+ main: {
8934
+ heading: "No element copied"
8935
+ },
8936
+ style: {
8937
+ color: "#a1a09d",
8938
+ marginLeft: "-10px"
8939
+ }
8940
+ }
8941
+ },
8942
+ {
8943
+ type: "Control",
8944
+ scope: "#/properties/EmptyBox",
8945
+ options: {
8946
+ widget: "EmptyBox"
8947
+ },
8948
+ config: {
8949
+ layout: { xs: 1, sm: 5 }
8950
+ }
8951
+ }
8952
+ ]
8777
8953
  },
8778
8954
  {
8779
8955
  type: "Control",