impaktapps-ui-builder 0.0.101-alpha.28 → 0.0.101-alpha.281

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.
Files changed (32) hide show
  1. package/dist/impaktapps-ui-builder.es.js +466 -223
  2. package/dist/impaktapps-ui-builder.es.js.map +1 -1
  3. package/dist/impaktapps-ui-builder.umd.js +16 -16
  4. package/dist/impaktapps-ui-builder.umd.js.map +1 -1
  5. package/dist/src/impaktapps-ui-builder/builder/build/uischema/card.d.ts +5 -1
  6. package/dist/src/impaktapps-ui-builder/builder/build/uischema/table.d.ts +1 -0
  7. package/dist/src/impaktapps-ui-builder/builder/elements/UiSchema/event/schema.d.ts +6 -0
  8. package/dist/src/impaktapps-ui-builder/builder/services/component.d.ts +2 -0
  9. package/dist/src/impaktapps-ui-builder/builder/services/event.d.ts +8 -0
  10. package/package.json +1 -1
  11. package/src/impaktapps-ui-builder/builder/build/buildText.ts +21 -18
  12. package/src/impaktapps-ui-builder/builder/build/buildUiSchema.ts +38 -30
  13. package/src/impaktapps-ui-builder/builder/build/uischema/buildPropertiesSection.ts +1 -1
  14. package/src/impaktapps-ui-builder/builder/build/uischema/card.ts +7 -4
  15. package/src/impaktapps-ui-builder/builder/build/uischema/coreSection.ts +1 -60
  16. package/src/impaktapps-ui-builder/builder/build/uischema/eventSection.ts +2 -2
  17. package/src/impaktapps-ui-builder/builder/build/uischema/table.ts +1 -0
  18. package/src/impaktapps-ui-builder/builder/build/uischema/validationSections.ts +0 -52
  19. package/src/impaktapps-ui-builder/builder/build/uischema/valueTab.ts +0 -50
  20. package/src/impaktapps-ui-builder/builder/elements/UiSchema/Component/schema.ts +33 -28
  21. package/src/impaktapps-ui-builder/builder/elements/UiSchema/Component/uiSchema.ts +26 -164
  22. package/src/impaktapps-ui-builder/builder/elements/UiSchema/PageMaster/uiSchema.ts +23 -97
  23. package/src/impaktapps-ui-builder/builder/elements/UiSchema/event/schema.ts +15 -12
  24. package/src/impaktapps-ui-builder/builder/elements/UiSchema/event/uiSchema.ts +19 -93
  25. package/src/impaktapps-ui-builder/builder/services/component.ts +220 -56
  26. package/src/impaktapps-ui-builder/builder/services/event.ts +175 -58
  27. package/src/impaktapps-ui-builder/runtime/services/events.ts +8 -1
  28. package/src/impaktapps-ui-builder/runtime/services/service.ts +14 -131
  29. package/dist/src/impaktapps-ui-builder/builder/build/buildPdfViewer.d.ts +0 -1
  30. package/dist/src/impaktapps-ui-builder/builder/build/uischema/pdfViewer.d.ts +0 -19
  31. package/src/impaktapps-ui-builder/builder/build/buildPdfViewer.ts +0 -22
  32. package/src/impaktapps-ui-builder/builder/build/uischema/pdfViewer.ts +0 -18
@@ -3,28 +3,8 @@ import { getSelectField } from "../../../build/uischema/buildPropertiesSection";
3
3
  export const EventUiSchema: any = (theme) => {
4
4
  const uiSchema = {
5
5
  type: "HorizontalLayout",
6
- heading: "Page-Event",
6
+ heading: "Page-Events",
7
7
  elements: [
8
- // {
9
- // type: "Control",
10
- // scope: "#/properties/pageName",
11
-
12
- // options: {
13
- // widget: "Box",
14
- // },
15
- // config: {
16
- // layout: 12,
17
- // main: {
18
- // heading: " ",
19
- // },
20
- // style: {
21
- // marginLeft: theme.spacing(3),
22
- // width:"auto",
23
- // fontSize:"12px",
24
- // color:"gray",
25
- // },
26
- // },
27
- // },
28
8
  {
29
9
  type: "TabLayout",
30
10
  config: {
@@ -75,7 +55,7 @@ export const EventUiSchema: any = (theme) => {
75
55
  },
76
56
  getSelectField("Handler", "Handler", [
77
57
  { label: "Custom", value: "custom" },
78
- { label: "Api", value: "api" },
58
+ { label: "API", value: "api" },
79
59
  { label: "Inbuilt Function", value: "inBuiltFunction" },
80
60
  { label: "Refresh", value: "refresh" },
81
61
  ]),
@@ -170,7 +150,7 @@ export const EventUiSchema: any = (theme) => {
170
150
 
171
151
  {
172
152
  accessorKey: "eventType",
173
- header: "Event Type",
153
+ header: "Event's Type",
174
154
  size: 300,
175
155
  type: "string"
176
156
  },
@@ -182,7 +162,7 @@ export const EventUiSchema: any = (theme) => {
182
162
  },
183
163
  {
184
164
  accessorKey: "Edit_Approve_Records",
185
- header: "Edit Widget",
165
+ header: "Edit",
186
166
  type: "action",
187
167
  size: 150,
188
168
  widget: {
@@ -255,67 +235,9 @@ export const EventUiSchema: any = (theme) => {
255
235
  },
256
236
  },
257
237
  ]
258
- // }]
259
238
  }
260
239
  ],
261
240
  },
262
- // {
263
- // type: "HorizontalLayout",
264
- // config: {
265
- // layout:{xs:12,sm: 6}
266
- // },
267
- // elements: [
268
- // {
269
- // type: "Control",
270
- // scope: "#/properties/RemoveItemButton",
271
- // options: {
272
- // widget: "IconButton",
273
- // },
274
- // config: {
275
- // layout: { xs: 1, sm: 1 },
276
- // main: {
277
- // onClick: "RemoveItemButton",
278
- // size: "large",
279
- // icon: "RejectIcon",
280
- // styleDefault: true,
281
- // },
282
- // style:{
283
- // marginLeft: "-10px"
284
- // }
285
- // },
286
- // },
287
- // {
288
- // type: "Control",
289
- // scope: "#/properties/copiedElementDetails",
290
-
291
- // options: {
292
- // widget: "Box",
293
- // },
294
- // config: {
295
- // layout: { xs: 6, sm: 6 },
296
- // main: {
297
- // heading: "No element copied",
298
- // },
299
- // style: {
300
- // color: "#535557",
301
- // marginLeft: "-10px",
302
- // fontSize: "12px",
303
- // marginTop: "4px"
304
- // },
305
- // },
306
- // },
307
- // {
308
- // type: "Control",
309
- // scope: "#/properties/EmptyBox",
310
- // options: {
311
- // widget: "EmptyBox",
312
- // },
313
- // config: {
314
- // layout: { xs: 1, sm: 5 },
315
- // },
316
- // },
317
- // ]
318
- // },
319
241
  {
320
242
  type: "WrapperLayout",
321
243
  config: {
@@ -402,15 +324,17 @@ export const EventUiSchema: any = (theme) => {
402
324
  config: {
403
325
  layout: 11,
404
326
  main: {
405
- heading: "Are you sure you want to delete ?",
327
+ heading: "Are you sure you want to delete this Event ?",
406
328
  },
407
329
  style:{
408
- marginTop: "-20px",
409
330
  fontSize: "20px",
410
331
  "&.MuiTypography-root": {
411
- padding: "10px 30px 20px 30px",
332
+ padding: "0px 20px",
412
333
  textAlign: "center",
413
- lineHeight: "1"
334
+ lineHeight: "1.2",
335
+ fontWeight: "normal",
336
+ fontSize: "18px",
337
+ marginBottom: theme.spacing(5)
414
338
  }
415
339
  }
416
340
  },
@@ -435,13 +359,14 @@ export const EventUiSchema: any = (theme) => {
435
359
  name: "No",
436
360
  startIcon: "ApproveIcon",
437
361
  variant: "contained",
438
- color: "info",
439
362
  type: "text",
440
363
  onClick: "deletePopUpEvent",
441
364
  size: "large",
442
365
  },
443
366
  style: {
444
367
  position: "absolute",
368
+ padding: "8px 0px",
369
+ fontSize: "16px",
445
370
  bottom: 0,
446
371
  left: 0,
447
372
  width: "50%",
@@ -469,7 +394,6 @@ export const EventUiSchema: any = (theme) => {
469
394
  layout: 6,
470
395
  main: {
471
396
  name: "Yes",
472
- startIcon: "ApproveIcon",
473
397
  variant: "contained",
474
398
  color: "error",
475
399
  type: "text",
@@ -478,6 +402,8 @@ export const EventUiSchema: any = (theme) => {
478
402
  },
479
403
  style: {
480
404
  position: "absolute",
405
+ padding: "8px 0px",
406
+ fontSize: "16px",
481
407
  bottom: 0,
482
408
  right: 0,
483
409
  width: "50%",
@@ -503,23 +429,23 @@ export const EventUiSchema: any = (theme) => {
503
429
  scope: "#/properties/pageName",
504
430
 
505
431
  options: {
506
- widget: "Box",
432
+ widget: "Breadcrumb",
507
433
  },
508
434
  config: {
509
435
  layout: 12,
510
436
  main: {
511
- heading: "",
437
+ onNavigatePopupNo: "onNavigatePopupNo",
438
+ onNavigatePopupYes: "onNavigatePopupYes"
512
439
  },
513
440
  style: {
514
441
  paddingLeft: theme.spacing(3),
515
- width:"100%",
516
- fontSize:"10px",
517
442
  color:theme.palette.grey[600],
443
+ fontSize:"10px",
518
444
  position: "fixed",
519
445
  bottom: "24px",
520
- backgroundColor: theme.palette.background.default,
521
446
  borderBottom: `1px solid ${theme.palette.common.black}29`,
522
447
  borderTop: `1px solid ${theme.palette.common.black}29`,
448
+ backgroundColor: theme.palette.background.default,
523
449
  },
524
450
  },
525
451
  },
@@ -10,54 +10,154 @@ import { ValueTab } from "../build/uischema/valueTab";
10
10
  import { ValidationSection } from "../build/uischema/validationSections";
11
11
  import { getFormdataFromSessionStorage, okHandler, saveFormdataInSessionStorage, saveHandler } from "./utils";
12
12
  const sectionLabels = {
13
- Select: ["Core", "Properties", "Value", "Event", "Style", "Validation"],
14
- MultipleSelect: ["Core", "Properties", "Value", "Event", "Style", "Validation"],
15
- Table: ["Core", "Components", "Properties", "Event", "Style", "Validation"],
16
- LeaderBoard: ["Core", "Components", "Properties", "Event", "Style", "Validation"],
13
+ Select: ["Core", "Properties", "Value", "Events", "Style", "Validation"],
14
+ MultipleSelect: ["Core", "Properties", "Value", "Events", "Style", "Validation"],
15
+ Table: ["Core", "Components", "Properties", "Events", "Style", "Validation"],
16
+ LeaderBoard: ["Core", "Components", "Properties", "Events", "Style", "Validation"],
17
17
  WrapperSection: ["Core", "Components", "Properties", "Style", "Validation"],
18
18
  TabSection: ["Core", "Components", "Properties", "Style", "Validation"],
19
- SpeedoMeter: ["Core", "Properties", "Event", "Style", "Validation"],
20
- card: ["Core", "Properties", "Event", "Style", "Validation"],
21
- UploadFile: ["Core", "Event", "Style", "Validation"],
22
- Graph: ["Core", "Properties", "Event", "Style", "Validation"],
23
- DownloadFile: ["Core", "Event", "Style", "Validation"],
24
- Box: ["Core", "Event", "Style", "Validation"],
25
- Properties: ["Core", "Properties", "Event", "Style", "Validation"],
26
- ProgressBarCard: ["Core", "Properties", "Event", "Style", "Validation"],
27
- RankCard: ["Core", "Properties", "Event", "Style", "Validation"],
28
- Slider: ["Core", "Components", "Event", "Style", "Validation"],
29
- Timer: ["Core", "Event", "Style", "Validation"],
30
- Rank: ["Core", "Event", "Style", "Validation"],
31
- Button: ["Core", "Properties", "Event", "Style", "Validation"],
19
+ SpeedoMeter: ["Core", "Properties", "Events", "Style", "Validation"],
20
+ card: ["Core", "Properties", "Events", "Style", "Validation"],
21
+ UploadFile: ["Core", "Events", "Style", "Validation"],
22
+ Graph: ["Core", "Properties", "Events", "Style", "Validation"],
23
+ DownloadFile: ["Core", "Events", "Style", "Validation"],
24
+ Box: ["Core", "Events", "Style", "Validation"],
25
+ Properties: ["Core", "Properties", "Events", "Style", "Validation"],
26
+ ProgressBarCard: ["Core", "Properties", "Events", "Style", "Validation"],
27
+ RankCard: ["Core", "Properties", "Events", "Style", "Validation"],
28
+ Slider: ["Core", "Components", "Events", "Style", "Validation"],
29
+ Timer: ["Core", "Events", "Style", "Validation"],
30
+ Rank: ["Core", "Events", "Style", "Validation"],
31
+ Button: ["Core", "Properties", "Events", "Style", "Validation"],
32
32
  Array: ["Core", "Components", "Validation"],
33
- Radio: ["Core", "Properties", "Event", "Style", "Validation"],
34
- Text: ["Core", "Properties", "Event", "Style", "Validation"],
35
- TextArea: ["Core", "Properties", "Event", "Style", "Validation"],
33
+ Radio: ["Core", "Properties", "Events", "Style", "Validation"],
34
+ Text: ["Core", "Properties", "Events", "Style", "Validation"],
35
+ TextArea: ["Core", "Properties", "Events", "Style", "Validation"],
36
36
  PopUp: ["Core", "Components", "Properties", "Style"],
37
- Stepper: ["Core", "Components", "Properties", "Event", "Style"],
38
- DataGrid: ["Core", "Components", "Properties", "Event", "Style"],
39
- InputSlider: ["Core", "Properties", "Event", "Style", "Validation"],
40
- TreeMap: ["Core", "Components", "Properties", "Event", "Style"],
37
+ Stepper: ["Core", "Components", "Properties", "Events", "Style"],
38
+ DataGrid: ["Core", "Components", "Properties", "Events", "Style"],
39
+ InputSlider: ["Core", "Properties", "Events", "Style", "Validation"],
40
+ TreeMap: ["Core", "Components", "Properties", "Events", "Style"],
41
41
  ColumnGroup: ["Core", "Components"],
42
- Thought: ["Core", "Properties", "Event", "Style", "Validation"]
42
+ Thought: ["Core", "Properties", "Events", "Style", "Validation"]
43
43
  }
44
44
 
45
- export function refreshPage (type: string, store: any) {
45
+ export function refreshPage(type: string, store: any) {
46
46
  const UiSchema = _.cloneDeep(componentBasicUiSchema(store.theme.myTheme))
47
+ const currentConfig = JSON.parse(sessionStorage.getItem("pageFormdata"));
47
48
  if (type) {
48
49
  const sectionUiSchema = {
49
50
  Core: CoreSection,
50
51
  Value: ValueTab,
51
52
  Style: StyleSection,
52
- Event: EventSection(store.theme.myTheme),
53
+ Events: EventSection(store.theme.myTheme),
53
54
  Components: TableSection(store.theme.myTheme),
54
55
  Properties: buildPropertiesSection(type),
55
56
  Validation: ValidationSection
56
57
  }
57
58
  const elements = sectionLabels[type]?.map(e => sectionUiSchema[e]);
58
- UiSchema.elements[0].config.main.tabLabels = sectionLabels[type] || ["Core", "Style", "Event", "Validation"];
59
+ UiSchema.elements[0].config.main.tabLabels = sectionLabels[type] || ["Core", "Style", "Events", "Validation"];
59
60
  UiSchema.elements[0].elements = elements || [CoreSection, StyleSection, EventSection(store.theme.myTheme), ValidationSection];
60
61
  }
62
+
63
+ // Get Widget Type of parent
64
+ const path = store.searchParams?.get("path");
65
+ const lastDotIndex = path.lastIndexOf('.')
66
+ const parentPath = path.slice(0,lastDotIndex)
67
+
68
+ const parentObj = _.get(currentConfig, parentPath)
69
+
70
+ if(parentObj?.type === "Table"){
71
+ UiSchema.elements[0].elements[0].elements[4] =
72
+ {
73
+ type: "Control",
74
+ scope: "#/properties/columnFormat",
75
+ options: {
76
+ widget: "SelectInputField",
77
+ },
78
+ config: {
79
+ layout: { xs: 6, sm: 6, md: 4, lg: 3 },
80
+ main: {
81
+ label: "Column Format",
82
+
83
+ },
84
+ },
85
+ };
86
+ UiSchema.elements[0].elements[0].elements[6] =
87
+ {
88
+ type: "Control",
89
+ scope: "#/properties/filteringOptions",
90
+ options: {
91
+ widget: "SelectInputField",
92
+ },
93
+ config: {
94
+ layout: { xs: 6, sm: 6, md: 4, lg: 3 },
95
+ main: {
96
+ label: "Filter Mode",
97
+ multiple: true
98
+ },
99
+ },
100
+ };
101
+ UiSchema.elements[0].elements[0].elements[5] =
102
+ {
103
+ type: "Control",
104
+ scope: "#/properties/enableFilter",
105
+ options: {
106
+ widget: "RadioInputField",
107
+ },
108
+ config: {
109
+ layout: { xs: 6, sm: 6, md: 4, lg: 3 },
110
+ main: {
111
+ label: "Enable Filter",
112
+ options: ["Yes", "No"],
113
+ },
114
+ },
115
+ },
116
+ UiSchema.elements[0].elements[0].elements[7] =
117
+ {
118
+ type: "Control",
119
+ scope: "#/properties/enableSorting",
120
+ options: {
121
+ widget: "RadioInputField",
122
+ },
123
+ config: {
124
+ layout: { xs: 6, sm: 6, md: 4, lg: 3 },
125
+ main: {
126
+ label: "Enable Sorting",
127
+ options: ["Yes", "No"],
128
+ },
129
+ },
130
+ },
131
+ UiSchema.elements[0].elements[0].elements[8] =
132
+ {
133
+ type: "Control",
134
+ scope: "#/properties/columnKey",
135
+ config: {
136
+ layout: { xs: 6, sm: 6, md: 4, lg: 3 },
137
+ main: {
138
+ label: "Column Key",
139
+ },
140
+ },
141
+ options: {
142
+ widget: "InputField",
143
+ },
144
+ },
145
+ UiSchema.elements[0].elements[0].elements[9] =
146
+ {
147
+ type: "Control",
148
+ scope: "#/properties/elementType",
149
+ options: {
150
+ widget: "SelectInputField",
151
+ },
152
+ config: {
153
+ layout: { xs: 6, sm: 6, md: 4, lg: 3 },
154
+ main: {
155
+ label: "Element Type",
156
+ },
157
+ },
158
+ }
159
+ }
160
+
61
161
  if (sessionStorage.getItem("copiedConfig") ) {
62
162
  this.ElementPathSetter(UiSchema);
63
163
  }
@@ -81,9 +181,38 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
81
181
  },
82
182
  getSchema: function () {
83
183
  const schema = _.cloneDeep(ComponentSchema);
84
- if (sessionStorage.getItem("copiedConfig") ) {
184
+ if (sessionStorage.getItem("copiedConfig")) {
85
185
  schema.properties.RemoveItemButton.disabled = false;
86
186
  }
187
+
188
+ const config = JSON.parse(sessionStorage.getItem("pageFormdata"));
189
+ const path = store.searchParams?.get("path");
190
+ const id = store.searchParams?.get("id")
191
+
192
+ let pathArray = [{label: config.name ?? "NewPage", path: `/PageMaster${id ? `?id=${id}` : ''}`}];
193
+
194
+ if (path) {
195
+ const pathArrayAll = path.split(".");
196
+ const arr: any = []
197
+ pathArrayAll.map((e: string, i: number) => {
198
+ if (i === 0) {
199
+ arr.push(e)
200
+ return;
201
+ }
202
+ arr.push(`${arr[i - 1]}.${e}`)
203
+ })
204
+
205
+
206
+ arr.map((e) => {
207
+ const data = _.get(config, e)
208
+ pathArray.push({
209
+ label: data?.name || data?.eventType || "NewComponent",
210
+ path: `/Component?path=${e}${id ? `&id=${id}` : ''}`
211
+ });
212
+ })
213
+ }
214
+
215
+ schema.properties.pageName.path = pathArray
87
216
  return schema;
88
217
  },
89
218
  okHandler: () => okHandler(store),
@@ -169,22 +298,22 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
169
298
  },
170
299
  deletePopUpComponent: function () {
171
300
  const rowId = dynamicData.path.split(".")[1];
172
- sessionStorage.setItem('rowId',rowId);
301
+ sessionStorage.setItem('rowId', rowId);
173
302
  store.updateDialog("popUpComponentSection");
174
303
  },
175
304
  deletePopUpEvent: function () {
176
305
  const rowId = dynamicData.path.split(".")[1];
177
- sessionStorage.setItem('rowId',rowId);
306
+ sessionStorage.setItem('rowId', rowId);
178
307
  store.updateDialog("popUpEventSection");
179
308
  },
180
309
 
181
- copyPasteElement: function(paramStore: any, setPage: any = this.setPage.bind(this) ){
310
+ copyPasteElement: function (paramStore: any, setPage: any = this.setPage.bind(this)) {
182
311
  const [actionType, elementType] = dynamicData.path.split('.').pop()?.split('_');
183
312
  actionType === "Copy" ? this.CopyElement(paramStore, elementType) : this.PasteElement(setPage, elementType);
184
313
  },
185
- CopyElement: function(paramStore: any = store, elementType: string){
186
- const schema = cloneDeep(paramStore.schema );
187
- const uiSchema = cloneDeep(paramStore.uiSchema );
314
+ CopyElement: function (paramStore: any = store, elementType: string) {
315
+ const schema = cloneDeep(paramStore.schema);
316
+ const uiSchema = cloneDeep(paramStore.uiSchema);
188
317
  schema.properties.RemoveItemButton.disabled = false;
189
318
 
190
319
  const rowId = dynamicData.path.split(".")[1];
@@ -194,11 +323,15 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
194
323
 
195
324
  this.ElementPathSetter(uiSchema,copiedFormData);
196
325
  sessionStorage.setItem('copiedConfig',JSON.stringify(copiedFormData));
326
+ store.setNotify({
327
+ SuccessMessage: `${elementType} Copied Successfully`,
328
+ Success: true,
329
+ })
197
330
  store.setSchema(schema);
198
331
  store.setUiSchema(uiSchema);
199
- },
200
- PasteElement: function( setPage: any , elementType: string){
201
- if (!sessionStorage.getItem("copiedConfig") ) {
332
+ },
333
+ PasteElement: function (setPage: any, elementType: string) {
334
+ if (!sessionStorage.getItem("copiedConfig")) {
202
335
  store.setNotify({
203
336
  FailMessage: "No item has been copied.",
204
337
  Fail: true,
@@ -206,41 +339,41 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
206
339
  return;
207
340
  }
208
341
  const pastedElementParentPath = store.searchParams?.get("path");
209
- if (!Array.isArray(store.formData.elements) ) {
342
+ if (!Array.isArray(store.formData.elements)) {
210
343
  store.formData.elements = []
211
344
  }
212
345
  if (!Array.isArray(store.formData.events)) {
213
346
  store.formData.events = []
214
347
  }
215
348
  saveFormdataInSessionStorage(store.ctx.core.data, pastedElementParentPath);
216
- const formData = getFormdataFromSessionStorage(pastedElementParentPath);
217
- const insertElementIndex = elementType === "Component" ? formData.elements.length : formData.events.length;
349
+ const formData = getFormdataFromSessionStorage(pastedElementParentPath);
350
+ const insertElementIndex = elementType === "Component" ? formData.elements.length : formData.events.length;
218
351
  const pastedElementPath = this.elementPathHandler(pastedElementParentPath, insertElementIndex, elementType);
219
352
 
220
353
  const copiedConfig = JSON.parse(sessionStorage.getItem("copiedConfig"));
221
354
  const notificationMessages = {
222
- Event: " The event cannot be integrated into the component section.",
223
- Component: "The component cannot be integrated into the event section."
355
+ Events: " The Events cannot be integrated into the component section.",
356
+ Component: "The component cannot be integrated into the Events section."
224
357
  };
225
- if(copiedConfig.Handler && elementType === "Component"){
358
+ if (copiedConfig.Handler && elementType === "Component") {
226
359
  store.setNotify({
227
- FailMessage: notificationMessages.Event,
360
+ FailMessage: notificationMessages.Events,
228
361
  Fail: true,
229
362
  });
230
363
  }
231
- else if(copiedConfig.name && elementType === "Event"){
364
+ else if(copiedConfig.name && elementType === "Events"){
232
365
  store.setNotify({
233
366
  FailMessage: notificationMessages.Component,
234
367
  Fail: true,
235
368
  });
236
369
  }
237
- else{
370
+ else {
238
371
  saveFormdataInSessionStorage(copiedConfig, pastedElementPath);
239
372
  setPage();
240
373
  }
241
- },
242
- RemoveItemButton: function(paramStore: any = store){
243
- const schema = cloneDeep(paramStore.schema );
374
+ },
375
+ RemoveItemButton: function (paramStore: any = store) {
376
+ const schema = cloneDeep(paramStore.schema);
244
377
  const uiSchema = cloneDeep(paramStore.uiSchema);
245
378
  schema.properties.RemoveItemButton.disabled = true;
246
379
  uiSchema.elements[2].elements[1].config.main.heading = `No element copied`;
@@ -248,15 +381,46 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
248
381
  store.setSchema(schema);
249
382
  store.setUiSchema(uiSchema);
250
383
  },
251
- elementPathHandler: function(parentPath: string, rowId: any, elementType: string){
252
- if(elementType === "Component"){
253
- return parentPath ? `${parentPath}.elements[${rowId}]` : `elements[${rowId}]`;
384
+ elementPathHandler: function (parentPath: string, rowId: any, elementType: string) {
385
+ if (elementType === "Component") {
386
+ return parentPath ? `${parentPath}.elements[${rowId}]` : `elements[${rowId}]`;
254
387
  }
255
- return parentPath ? `${parentPath}.events[${rowId}]` : `events[${rowId}]`;
388
+ return parentPath ? `${parentPath}.events[${rowId}]` : `events[${rowId}]`;
256
389
  },
257
- ElementPathSetter: function(uiSchema: any,copiedFormData?: any){
390
+ ElementPathSetter: function (uiSchema: any, copiedFormData?: any) {
258
391
  const formData = copiedFormData || JSON.parse(sessionStorage.getItem("copiedConfig"));
259
- uiSchema.elements[2].elements[1].config.main.heading = `Copied Path: ${formData.pageName}`;
392
+ if(uiSchema?.elements?.[1]?.elements?.[0]?.config?.main?.headerIcons){
393
+ uiSchema.elements[1].elements[0].config.main.headerIcons.elements[1].widget.config.main.tooltipMessage = `Copied Component: ${formData.name}`;
394
+ }
395
+ else if(uiSchema?.elements?.[0]?.elements?.[1]?.elements?.[0]?.config?.main?.headerIcons){
396
+ uiSchema.elements[0].elements[1].elements[0].config.main.headerIcons.elements[1].widget.config.main.tooltipMessage = `Copied Component: ${formData.name}`;
397
+ }
398
+
399
+
400
+ if(uiSchema?.elements?.[1]?.elements?.[1]?.config?.main?.headerIcons){
401
+ uiSchema.elements[1].elements[1].config.main.headerIcons.elements[1].widget.config.main.tooltipMessage = `Copied Event: ${formData.eventType}`;
402
+ }
403
+ else if(uiSchema?.elements?.[0]?.elements?.[1]?.config?.main?.headerIcons){
404
+ uiSchema.elements[0].elements[1].config.main.headerIcons.elements[1].widget.config.main.tooltipMessage = `Copied Component: ${formData.eventType}`;
405
+ }
406
+ },
407
+
408
+
409
+ onNavigatePopupYes: function() {
410
+ try{
411
+ store.navigate(sessionStorage.getItem("pendingNavigatePath"))
412
+ store.updateDialog(`pageNamepopup`)
413
+ }
414
+ catch(e){
415
+ store.updateDialog(`pageNamepopup`)
416
+ store.setNotify({
417
+ FailMessage: "Couldn't navigate page",
418
+ Fail: true,
419
+ })
420
+ }
421
+ },
422
+ onNavigatePopupNo: function() {
423
+ store.updateDialog(`pageNamepopup`)
260
424
  }
261
425
  }
262
426
  };