impaktapps-ui-builder 0.0.100 → 0.0.101

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 (56) hide show
  1. package/dist/impaktapps-ui-builder.es.js +1825 -1436
  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/buildThoughtOfTheDay.d.ts +1 -0
  6. package/dist/src/impaktapps-ui-builder/builder/build/uischema/button.d.ts +0 -1
  7. package/dist/src/impaktapps-ui-builder/builder/build/uischema/card.d.ts +90 -23
  8. package/dist/src/impaktapps-ui-builder/builder/build/uischema/eventSection.d.ts +55 -2
  9. package/dist/src/impaktapps-ui-builder/builder/build/uischema/graph.d.ts +52 -22
  10. package/dist/src/impaktapps-ui-builder/builder/build/uischema/leaderBoard.d.ts +10 -301
  11. package/dist/src/impaktapps-ui-builder/builder/build/uischema/progressBar.d.ts +6 -1
  12. package/dist/src/impaktapps-ui-builder/builder/build/uischema/tableSection.d.ts +50 -2
  13. package/dist/src/impaktapps-ui-builder/builder/build/uischema/thoughtOfTheDay.d.ts +17 -0
  14. package/dist/src/impaktapps-ui-builder/builder/build/uischema/timer.d.ts +1 -14
  15. package/dist/src/impaktapps-ui-builder/builder/elements/UiSchema/PageMaster/schema.d.ts +3 -0
  16. package/dist/src/impaktapps-ui-builder/builder/elements/UiSchema/event/schema.d.ts +3 -0
  17. package/dist/src/impaktapps-ui-builder/builder/services/component.d.ts +8 -2
  18. package/dist/src/impaktapps-ui-builder/builder/services/event.d.ts +5 -0
  19. package/dist/src/impaktapps-ui-builder/builder/services/pageMaster.d.ts +5 -0
  20. package/dist/src/impaktapps-ui-builder/builder/services/utils.d.ts +1 -1
  21. package/package.json +5 -1
  22. package/src/impaktapps-ui-builder/builder/build/buildCard.ts +7 -3
  23. package/src/impaktapps-ui-builder/builder/build/buildConfig.ts +1 -1
  24. package/src/impaktapps-ui-builder/builder/build/buildHorizontalBarGraph.ts +18 -14
  25. package/src/impaktapps-ui-builder/builder/build/buildInputSlider.ts +1 -1
  26. package/src/impaktapps-ui-builder/builder/build/buildLeaderboard.ts +18 -13
  27. package/src/impaktapps-ui-builder/builder/build/buildLineGraph.ts +10 -2
  28. package/src/impaktapps-ui-builder/builder/build/buildPieGraph.ts +4 -15
  29. package/src/impaktapps-ui-builder/builder/build/buildRankCard.ts +4 -10
  30. package/src/impaktapps-ui-builder/builder/build/buildStackBarGraph.ts +16 -4
  31. package/src/impaktapps-ui-builder/builder/build/buildThoughtOfTheDay.ts +22 -0
  32. package/src/impaktapps-ui-builder/builder/build/buildUiSchema.ts +7 -0
  33. package/src/impaktapps-ui-builder/builder/build/buildUplaodFile.ts +16 -19
  34. package/src/impaktapps-ui-builder/builder/build/uischema/buildPropertiesSection.ts +17 -10
  35. package/src/impaktapps-ui-builder/builder/build/uischema/button.ts +0 -1
  36. package/src/impaktapps-ui-builder/builder/build/uischema/card.ts +102 -46
  37. package/src/impaktapps-ui-builder/builder/build/uischema/eventSection.ts +44 -0
  38. package/src/impaktapps-ui-builder/builder/build/uischema/graph.ts +13 -28
  39. package/src/impaktapps-ui-builder/builder/build/uischema/leaderBoard.ts +10 -366
  40. package/src/impaktapps-ui-builder/builder/build/uischema/progressBar.ts +1 -1
  41. package/src/impaktapps-ui-builder/builder/build/uischema/rankCard.ts +1 -1
  42. package/src/impaktapps-ui-builder/builder/build/uischema/runnerBoyProgressBar.ts +1 -1
  43. package/src/impaktapps-ui-builder/builder/build/uischema/tableSection.ts +45 -1
  44. package/src/impaktapps-ui-builder/builder/build/uischema/thoughtOfTheDay.ts +14 -0
  45. package/src/impaktapps-ui-builder/builder/build/uischema/timer.ts +2 -16
  46. package/src/impaktapps-ui-builder/builder/elements/UiSchema/Component/schema.ts +5 -1
  47. package/src/impaktapps-ui-builder/builder/elements/UiSchema/Component/uiSchema.ts +271 -154
  48. package/src/impaktapps-ui-builder/builder/elements/UiSchema/PageMaster/schema.ts +4 -1
  49. package/src/impaktapps-ui-builder/builder/elements/UiSchema/PageMaster/uiSchema.ts +327 -120
  50. package/src/impaktapps-ui-builder/builder/elements/UiSchema/event/schema.ts +4 -1
  51. package/src/impaktapps-ui-builder/builder/elements/UiSchema/event/uiSchema.ts +188 -65
  52. package/src/impaktapps-ui-builder/builder/services/component.ts +94 -8
  53. package/src/impaktapps-ui-builder/builder/services/event.ts +19 -4
  54. package/src/impaktapps-ui-builder/builder/services/pageMaster.ts +20 -2
  55. package/src/impaktapps-ui-builder/builder/services/utils.ts +2 -2
  56. package/src/impaktapps-ui-builder/runtime/services/events.ts +23 -19
@@ -106,6 +106,30 @@ export const EventUiSchema: any = (theme) => {
106
106
  },
107
107
  }
108
108
  },
109
+
110
+ {
111
+ widget: {
112
+ type: "Control",
113
+ scope: "#/properties/Paste_Event",
114
+
115
+ options: {
116
+ widget: "IconButton",
117
+ },
118
+ config: {
119
+ main: {
120
+ // color: "info",
121
+ onClick: "copyPasteElement",
122
+ size: "small",
123
+ icon: "PasteIcon",
124
+ iconLabel: "Paste",
125
+ styleDefault: true,
126
+ },
127
+ style: {
128
+ mt: "6px",
129
+ },
130
+ },
131
+ }
132
+ },
109
133
  ]
110
134
  },
111
135
  disableAction: true,
@@ -166,20 +190,88 @@ export const EventUiSchema: any = (theme) => {
166
190
  },
167
191
  },
168
192
  },
193
+
194
+ {
195
+ header: "Copy",
196
+ field: "Copy_Event",
197
+ flex: 1,
198
+ widget: {
199
+ type: "Control",
200
+ scope: "#/properties/Copy_Event",
201
+ options: {
202
+ widget: "IconButton",
203
+ },
204
+ config: {
205
+ main: {
206
+ icon: "FileCopyIcon",
207
+ // color: "error",
208
+ onClick: "copyPasteElement",
209
+ styleDefault: true,
210
+ },
211
+ },
212
+ },
213
+ },
169
214
  ]
170
215
  // }]
171
216
  }
172
217
  ],
173
218
  },
174
219
  {
175
- type: "Control",
176
- scope: "#/properties/EmptyBox",
177
- options: {
178
- widget: "EmptyBox",
179
- },
220
+ type: "HorizontalLayout",
180
221
  config: {
181
- layout: { xs: 4, sm: 8 },
222
+ layout:{xs:12,sm: 6}
182
223
  },
224
+ elements: [
225
+ {
226
+ type: "Control",
227
+ scope: "#/properties/RemoveItemButton",
228
+ options: {
229
+ widget: "IconButton",
230
+ },
231
+ config: {
232
+ layout: { xs: 1, sm: 1 },
233
+ main: {
234
+ onClick: "RemoveItemButton",
235
+ size: "large",
236
+ icon: "RejectIcon",
237
+ styleDefault: true,
238
+ },
239
+ style:{
240
+ marginLeft: "-10px"
241
+ }
242
+ },
243
+ },
244
+ {
245
+ type: "Control",
246
+ scope: "#/properties/copiedElementDetails",
247
+
248
+ options: {
249
+ widget: "Box",
250
+ },
251
+ config: {
252
+ layout: { xs: 6, sm: 6 },
253
+ main: {
254
+ heading: "No element copied",
255
+ },
256
+ style: {
257
+ color: "#535557",
258
+ marginLeft: "-10px",
259
+ fontSize: "12px",
260
+ marginTop: "4px"
261
+ },
262
+ },
263
+ },
264
+ {
265
+ type: "Control",
266
+ scope: "#/properties/EmptyBox",
267
+ options: {
268
+ widget: "EmptyBox",
269
+ },
270
+ config: {
271
+ layout: { xs: 1, sm: 5 },
272
+ },
273
+ },
274
+ ]
183
275
  },
184
276
  {
185
277
  type: "Control",
@@ -237,28 +329,20 @@ export const EventUiSchema: any = (theme) => {
237
329
  layout: {
238
330
  xs: 12,
239
331
  sm: 12,
240
- md: 6,
241
- lg: 6,
332
+ md: 12,
333
+ lg: 12,
242
334
  },
243
335
  main: {
336
+ title: "WARNING!"
244
337
  },
245
338
  style: {
246
- "& .MuiPaper-root":{
247
- width: '30%',
248
- },
249
- "& .MuiTypography-root":{
250
- padding: 0
251
- },
252
- wrapperStyle: {
253
- width: { xs: "100%", sm: "100%", md: "98%" },
254
- }
255
339
  }
256
340
  },
257
341
  elements:
258
342
  [
259
343
  {
260
344
  type: "Control",
261
- scope: "#/properties/label",
345
+ scope: "#/properties/popupText",
262
346
  options: {
263
347
  widget: "Box",
264
348
  },
@@ -267,59 +351,97 @@ export const EventUiSchema: any = (theme) => {
267
351
  main: {
268
352
  heading: "Are you sure you want to delete ?",
269
353
  },
270
- style: {
271
- marginTop: "-40px"
354
+ style:{
355
+ marginTop: "-20px",
356
+ fontSize: "20px",
357
+ "&.MuiTypography-root": {
358
+ padding: "10px 30px 20px 30px",
359
+ textAlign: "center",
360
+ lineHeight: "1"
361
+ }
272
362
  }
273
363
  },
274
364
  },
275
365
  {
276
- type: "Control",
277
- scope: "#/properties/EmptyBox",
278
- options: {
279
- widget: "EmptyBox",
280
- },
366
+ type: "WrapperLayout",
281
367
  config: {
368
+ layout: 12,
282
369
  main: {},
283
- layout: { xs: 11, sm: 5.5, md: 5.5, lg: 5.5 },
284
- },
285
- },
286
- {
287
- type: "Control",
288
- scope: "#/properties/ConfirmDeleteEventButton",
289
- options: {
290
- widget: "Button",
370
+
291
371
  },
292
- config: {
293
- layout: 3,
294
- main: {
295
- name: "Yes",
296
- startIcon: "ApproveIcon",
297
- variant: "contained",
298
- color: "error",
299
- type: "text",
300
- onClick: "deleteEvent",
301
- size: "small",
372
+ elements: [
373
+ {
374
+ type: "Control",
375
+ scope: "#/properties/CancelDeleteEventButton",
376
+ options: {
377
+ widget: "Button",
378
+ },
379
+ config: {
380
+ layout: 6,
381
+ main: {
382
+ name: "No",
383
+ startIcon: "ApproveIcon",
384
+ variant: "contained",
385
+ color: "info",
386
+ type: "text",
387
+ onClick: "deletePopUpEvent",
388
+ size: "large",
389
+ },
390
+ style: {
391
+ position: "absolute",
392
+ bottom: 0,
393
+ left: 0,
394
+ width: "50%",
395
+ borderRadius: 0,
396
+ boxShadow: 0,
397
+ backgroundColor: "transparent",
398
+ color: theme.palette.primary.main,
399
+ borderTop: `0.5px solid ${theme.palette.grey[600]}`,
400
+ borderRight: `0.5px solid ${theme.palette.grey[600]}`,
401
+ "&:hover": {
402
+ color: theme.palette.primary.contrastText,
403
+ backgroundColor: theme.palette.primary.main,
404
+ boxShadow: "none"
405
+ }
406
+ }
407
+ },
302
408
  },
303
- },
304
- },
305
- {
306
- type: "Control",
307
- scope: "#/properties/CancelDeleteEventButton",
308
- options: {
309
- widget: "Button",
310
- },
311
- config: {
312
- layout: 3,
313
- main: {
314
- name: "No",
315
- startIcon: "ApproveIcon",
316
- variant: "contained",
317
- color: "info",
318
- type: "text",
319
- onClick: "deletePopUpEvent",
320
- size: "small",
409
+ {
410
+ type: "Control",
411
+ scope: "#/properties/ConfirmDeleteEventButton",
412
+ options: {
413
+ widget: "Button",
414
+ },
415
+ config: {
416
+ layout: 6,
417
+ main: {
418
+ name: "Yes",
419
+ startIcon: "ApproveIcon",
420
+ variant: "contained",
421
+ color: "error",
422
+ type: "text",
423
+ onClick: "deleteEvent",
424
+ size: "large",
425
+ },
426
+ style: {
427
+ position: "absolute",
428
+ bottom: 0,
429
+ right: 0,
430
+ width: "50%",
431
+ borderRadius: 0,
432
+ boxShadow: 0,
433
+ backgroundColor: "transparent",
434
+ color: theme.palette.error.main,
435
+ borderTop: `0.5px solid ${theme.palette.grey[600]}`,
436
+ "&:hover": {
437
+ color: theme.palette.error.contrastText,
438
+ backgroundColor: theme.palette.error.main,
439
+ boxShadow: "none"
440
+ }
441
+ }
442
+ },
321
443
  },
322
- },
444
+ ]
323
445
  },
324
446
  ]
325
447
  },
@@ -350,7 +472,7 @@ export const EventUiSchema: any = (theme) => {
350
472
  },
351
473
  elements: [
352
474
  {
353
-
475
+
354
476
  type: "Control",
355
477
  scope: "#/properties/FooterText",
356
478
  options: {
@@ -364,13 +486,14 @@ export const EventUiSchema: any = (theme) => {
364
486
  color: theme?.palette?.text.disabled || "#AFAFAF",
365
487
  fontSize: '12px',
366
488
  textAlign: 'center',
367
- lineHeight: 1,
489
+ lineHeight: 2,
368
490
  width: 'fit-content',
369
491
  left: '50%',
370
492
  position: 'relative',
371
493
  margin: 0,
372
494
  flexGrow: 1,
373
- height: 0
495
+ height: 0,
496
+ transform: "translate(-50%,0%)"
374
497
  }
375
498
  },
376
499
  },
@@ -1,4 +1,4 @@
1
- import _ from "lodash";
1
+ import _, { cloneDeep } from "lodash";
2
2
  import { ComponentSchema } from "../elements/UiSchema/Component/schema";
3
3
  import { componentBasicUiSchema } from "../elements/UiSchema/Component/uiSchema";
4
4
  import { CoreSection } from "../build/uischema/coreSection";
@@ -38,12 +38,11 @@ const sectionLabels = {
38
38
  DataGrid: ["Core", "Components", "Properties", "Event", "Style"],
39
39
  InputSlider: ["Core", "Properties", "Event", "Style", "Validation"],
40
40
  TreeMap: ["Core", "Components", "Properties", "Event", "Style"],
41
- ColumnGroup: ["Core", "Components"]
41
+ ColumnGroup: ["Core", "Components"],
42
+ Thought: ["Core", "Properties", "Event", "Style", "Validation"]
42
43
  }
43
44
 
44
-
45
-
46
- export const refreshPage = (type: string, store: any) => {
45
+ export function refreshPage (type: string, store: any) {
47
46
  const UiSchema = _.cloneDeep(componentBasicUiSchema(store.theme.myTheme))
48
47
  if (type) {
49
48
  const sectionUiSchema = {
@@ -58,7 +57,9 @@ export const refreshPage = (type: string, store: any) => {
58
57
  const elements = sectionLabels[type]?.map(e => sectionUiSchema[e]);
59
58
  UiSchema.elements[1].config.main.tabLabels = sectionLabels[type] || ["Core", "Style", "Event", "Validation"];
60
59
  UiSchema.elements[1].elements = elements || [CoreSection, StyleSection, EventSection(store.theme.myTheme), ValidationSection];
61
-
60
+ }
61
+ if (sessionStorage.getItem("copiedConfig") ) {
62
+ this.ElementPathSetter(UiSchema);
62
63
  }
63
64
  store.setUiSchema(UiSchema);
64
65
  }
@@ -79,10 +80,14 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
79
80
  return getFormdataFromSessionStorage(path)
80
81
  },
81
82
  getSchema: function () {
82
- return ComponentSchema;
83
+ const schema = _.cloneDeep(ComponentSchema);
84
+ if (sessionStorage.getItem("copiedConfig") ) {
85
+ schema.properties.RemoveItemButton.disabled = false;
86
+ }
87
+ return schema;
83
88
  },
84
89
  okHandler: () => okHandler(store),
85
- saveHandler: async () => await saveHandler(store, service, submitHandler, "PageMaster"),
90
+ saveHandler: async () => await saveHandler(store, service, submitHandler),
86
91
  onChange: function () {
87
92
  if (
88
93
  store?.formData?.type !== store?.newData?.type &&
@@ -172,5 +177,86 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
172
177
  sessionStorage.setItem('rowId',rowId);
173
178
  store.updateDialog("popUpEventSection");
174
179
  },
180
+
181
+ copyPasteElement: function(paramStore: any, setPage: any = this.setPage.bind(this) ){
182
+ const [actionType, elementType] = dynamicData.path.split('.').pop()?.split('_');
183
+ actionType === "Copy" ? this.CopyElement(paramStore, elementType) : this.PasteElement(setPage, elementType);
184
+ },
185
+ CopyElement: function(paramStore: any = store, elementType: string){
186
+ const schema = cloneDeep(paramStore.schema );
187
+ const uiSchema = cloneDeep(paramStore.uiSchema );
188
+ schema.properties.RemoveItemButton.disabled = false;
189
+
190
+ const rowId = dynamicData.path.split(".")[1];
191
+ const parentPathOfCopiedComponent = store.searchParams?.get("path");
192
+ const copiedElementPath = this.elementPathHandler(parentPathOfCopiedComponent, rowId, elementType);
193
+ const copiedFormData = getFormdataFromSessionStorage(copiedElementPath);
194
+
195
+ this.ElementPathSetter(uiSchema,copiedFormData);
196
+ sessionStorage.setItem('copiedConfig',JSON.stringify(copiedFormData));
197
+ store.setSchema(schema);
198
+ store.setUiSchema(uiSchema);
199
+ },
200
+ PasteElement: function( setPage: any , elementType: string){
201
+ if (!sessionStorage.getItem("copiedConfig") ) {
202
+ store.setNotify({
203
+ FailMessage: "No item has been copied.",
204
+ Fail: true,
205
+ });
206
+ return;
207
+ }
208
+ const pastedElementParentPath = store.searchParams?.get("path");
209
+ if (!Array.isArray(store.formData.elements) ) {
210
+ store.formData.elements = []
211
+ }
212
+ if (!Array.isArray(store.formData.events)) {
213
+ store.formData.events = []
214
+ }
215
+ saveFormdataInSessionStorage(store.ctx.core.data, pastedElementParentPath);
216
+ const formData = getFormdataFromSessionStorage(pastedElementParentPath);
217
+ const insertElementIndex = elementType === "Component" ? formData.elements.length : formData.events.length;
218
+ const pastedElementPath = this.elementPathHandler(pastedElementParentPath, insertElementIndex, elementType);
219
+
220
+ const copiedConfig = JSON.parse(sessionStorage.getItem("copiedConfig"));
221
+ const notificationMessages = {
222
+ Event: " The event cannot be integrated into the component section.",
223
+ Component: "The component cannot be integrated into the event section."
224
+ };
225
+ if(copiedConfig.Handler && elementType === "Component"){
226
+ store.setNotify({
227
+ FailMessage: notificationMessages.Event,
228
+ Fail: true,
229
+ });
230
+ }
231
+ else if(copiedConfig.name && elementType === "Event"){
232
+ store.setNotify({
233
+ FailMessage: notificationMessages.Component,
234
+ Fail: true,
235
+ });
236
+ }
237
+ else{
238
+ saveFormdataInSessionStorage(copiedConfig, pastedElementPath);
239
+ setPage();
240
+ }
241
+ },
242
+ RemoveItemButton: function(paramStore: any = store){
243
+ const schema = cloneDeep(paramStore.schema );
244
+ const uiSchema = cloneDeep(paramStore.uiSchema);
245
+ schema.properties.RemoveItemButton.disabled = true;
246
+ uiSchema.elements[2].elements[1].config.main.heading = `No element copied`;
247
+ sessionStorage.removeItem('copiedConfig');
248
+ store.setSchema(schema);
249
+ store.setUiSchema(uiSchema);
250
+ },
251
+ elementPathHandler: function(parentPath: string, rowId: any, elementType: string){
252
+ if(elementType === "Component"){
253
+ return parentPath ? `${parentPath}.elements[${rowId}]` : `elements[${rowId}]`;
254
+ }
255
+ return parentPath ? `${parentPath}.events[${rowId}]` : `events[${rowId}]`;
256
+ },
257
+ ElementPathSetter: function(uiSchema: any,copiedFormData?: any){
258
+ const formData = copiedFormData || JSON.parse(sessionStorage.getItem("copiedConfig"));
259
+ uiSchema.elements[2].elements[1].config.main.heading = `Copied Path: ${formData.pageName}`;
260
+ }
175
261
  }
176
262
  };
@@ -1,7 +1,7 @@
1
1
  import { EventSchema } from "../elements/UiSchema/event/schema";
2
2
  import { EventUiSchema } from "../elements/UiSchema/event/uiSchema";
3
3
  import Component from "./component";
4
- import { okHandler, saveFormdataInSessionStorage, saveHandler } from "./utils";
4
+ import { okHandler, saveFormdataInSessionStorage, saveHandler, getFormdataFromSessionStorage } from "./utils";
5
5
  import { APISection } from "../build/uischema/apiSection";
6
6
  import { getRadioInputField, getSelectField, getTextArea } from "../build/uischema/buildPropertiesSection";
7
7
  import { refreshSectionUiSchema } from "../build/uischema/refresh";
@@ -85,6 +85,10 @@ export default (
85
85
  ...functionsName
86
86
  ]
87
87
  }
88
+ if (sessionStorage.getItem("copiedConfig") ) {
89
+ Component(store, dynamicData, submitHandler, service).ElementPathSetter(uiSchema);
90
+ schema.properties.RemoveItemButton.disabled = false;
91
+ }
88
92
  store.setSchema(schema)
89
93
  store.setUiSchema(uiSchema)
90
94
  },
@@ -94,10 +98,14 @@ export default (
94
98
  return EventUiSchema;
95
99
  },
96
100
  getSchema: () => {
97
- return EventSchema;
101
+ const schema = _.cloneDeep(EventSchema);
102
+ if (sessionStorage.getItem("copiedConfig") ) {
103
+ schema.properties.RemoveItemButton.disabled = false;
104
+ }
105
+ return schema;
98
106
  },
99
107
  okHandler: () => okHandler(store),
100
- saveHandler: async () => await saveHandler(store, service, submitHandler, "PageMaster"),
108
+ saveHandler: async () => await saveHandler(store, service, submitHandler),
101
109
  onChange: function () {
102
110
  if (
103
111
  store?.formData?.Handler !== store?.newData?.Handler &&
@@ -138,6 +146,13 @@ export default (
138
146
  const rowId = dynamicData.path.split(".")[1];
139
147
  sessionStorage.setItem('rowId',rowId);
140
148
  store.updateDialog("popUpEvent");
141
- }
149
+ },
150
+ copyPasteElement: function(){
151
+ Component(store, dynamicData, submitHandler, service).copyPasteElement(store,this.setPage.bind(this));
152
+ },
153
+ RemoveItemButton: function(){
154
+ Component(store, dynamicData, submitHandler, service).RemoveItemButton(store)
155
+ },
156
+
142
157
  }
143
158
  };
@@ -34,10 +34,18 @@ export default (funcParams: funcParamsProps) => {
34
34
  return config
35
35
  },
36
36
  getUiSchema: function () {
37
- return PageMasterUiSchema(store.theme.myTheme);
37
+ const UiSchema = _.cloneDeep(PageMasterUiSchema(store.theme.myTheme));
38
+ if (sessionStorage.getItem("copiedConfig") ) {
39
+ Component(store, dynamicData, submitHandler, service).ElementPathSetter(UiSchema)
40
+ }
41
+ return UiSchema;
38
42
  },
39
43
  getSchema: () => {
40
- return PageMasterSchema;
44
+ const schema = _.cloneDeep(PageMasterSchema);
45
+ if (sessionStorage.getItem("copiedConfig") ) {
46
+ schema.properties.RemoveItemButton.disabled = false;
47
+ }
48
+ return schema;
41
49
  },
42
50
  backHandler: () => {
43
51
  sessionStorage.removeItem("pageFormdata")
@@ -101,5 +109,15 @@ export default (funcParams: funcParamsProps) => {
101
109
  sessionStorage.setItem('rowId',rowId);
102
110
  store.updateDialog("popUpPageMasterEvent");
103
111
  },
112
+
113
+
114
+ copyPasteElement: function(){
115
+ Component(store, dynamicData, submitHandler, service).copyPasteElement(store,this.setPage.bind(this));
116
+ },
117
+
118
+ RemoveItemButton: function(){
119
+ Component(store, dynamicData, submitHandler, service).RemoveItemButton(store)
120
+ },
121
+
104
122
  }
105
123
  };
@@ -57,7 +57,7 @@ export const getFormdataFromSessionStorage = (path?: string) => {
57
57
 
58
58
  }
59
59
 
60
- export async function saveHandler(store, service, submitHandler, pageName?: string) {
60
+ export async function saveHandler(store, service, submitHandler) {
61
61
  const id = store.searchParams?.get("id");
62
62
  const path = store.searchParams?.get("path");
63
63
  saveFormdataInSessionStorage(store.ctx.core.data, path);
@@ -65,7 +65,7 @@ export async function saveHandler(store, service, submitHandler, pageName?: stri
65
65
  if (_.isEmpty(store.ctx.core.errors)) {
66
66
  try {
67
67
  const saveReturn = await submitHandler(store, service, config);
68
- navigateHandler(store, true, pageName ? `/${pageName}?id=${saveReturn.id}` : "/PageMasterRecords")
68
+ navigateHandler(store, true,"/PageMasterRecords")
69
69
  } catch (err) {
70
70
  navigateHandler(store, false)
71
71
  }
@@ -146,32 +146,36 @@ function executeCustomHandler(params: handlersProps) {
146
146
  }
147
147
 
148
148
  function mergeFormdata(handlerResponse: any, componentName: string, eventConfig: any, store: any, service: any, formDataHolder: any) {
149
- if (eventConfig.type === "Select" && handlerResponse?.data) {
150
- store.setSchema((pre) => {
151
- return {
152
- ...pre, properties: {
153
- ...pre.properties, [componentName]: {
154
- ...pre.properties?.[componentName],
155
- oneOf: handlerResponse.data
149
+ if (eventConfig.type === "Select" && handlerResponse?.data) {
150
+ if (!_.isEmpty(handlerResponse?.data)) {
151
+ store.setSchema((pre) => {
152
+ return {
153
+ ...pre, properties: {
154
+ ...pre.properties, [componentName]: {
155
+ ...pre.properties?.[componentName],
156
+ oneOf: handlerResponse.data
157
+ }
156
158
  }
157
159
  }
158
- }
159
- })
160
+ })
161
+ }
160
162
  }
161
163
  else if (eventConfig.type === "MultipleSelect" && handlerResponse?.data) {
162
- store.setSchema((pre) => {
163
- return {
164
- ...pre, properties: {
165
- ...pre.properties, [componentName]: {
166
- ...pre.properties?.[componentName],
167
- type: "array",
168
- items: {
169
- oneOf: handlerResponse?.data
164
+ if (!_.isEmpty(handlerResponse?.data)) {
165
+ store.setSchema((pre) => {
166
+ return {
167
+ ...pre, properties: {
168
+ ...pre.properties, [componentName]: {
169
+ ...pre.properties?.[componentName],
170
+ type: "array",
171
+ items: {
172
+ oneOf: handlerResponse?.data
173
+ }
170
174
  }
171
175
  }
172
176
  }
173
- }
174
- })
177
+ })
178
+ }
175
179
  }
176
180
  else if (eventConfig.type === "page") {
177
181
  if (!(_.isEmpty(handlerResponse?.data) && handlerResponse?.data)) {