impaktapps-ui-builder 0.0.382-alpha.314 → 0.0.382-alpha.316

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.
@@ -8,8 +8,8 @@ declare const _default: (store: any, dynamicData: any, submitHandler: any, servi
8
8
  saveHandler: () => Promise<void>;
9
9
  onChange: () => void;
10
10
  editComponents: () => void;
11
- deleteComponents: () => void;
12
- deleteEvent: () => void;
11
+ deleteComponents: (shouldUpdateDialog?: boolean) => void;
12
+ deleteEvent: (shouldUpdateDialog?: boolean) => void;
13
13
  widgetAddClickHandler: () => void;
14
14
  eventEditHandler: () => void;
15
15
  eventAddHandler: () => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "impaktapps-ui-builder",
3
- "version": "0.0.382-alpha.314",
3
+ "version": "0.0.382-alpha.316",
4
4
  "scripts": {
5
5
  "dev": "vite",
6
6
  "build": "tsc && vite build",
@@ -303,13 +303,21 @@ export const componentBasicUiSchema: any = {
303
303
  },
304
304
  ]
305
305
  },
306
+
307
+
308
+
309
+
310
+
311
+
312
+
313
+
306
314
  {
307
315
  type: "Control",
308
316
  scope: "#/properties/popUpEventSection",
309
- options:{
317
+ options: {
310
318
  widget: "PopUp"
311
319
  },
312
- config:{
320
+ config: {
313
321
  layout: {
314
322
  xs: 12,
315
323
  sm: 12,
@@ -319,74 +327,160 @@ export const componentBasicUiSchema: any = {
319
327
  main: {
320
328
  },
321
329
  },
322
- elemetns:[
323
- {
324
- type: "Control",
325
- scope: "#/properties/label",
326
- options: {
327
- widget: "Box",
328
- },
329
- config: {
330
- layout: 12,
331
- main: {
332
- heading: "Are you sure you want to delete ?",
330
+ elements:
331
+ [
332
+ {
333
+ type: "Control",
334
+ scope: "#/properties/label",
335
+ options: {
336
+ widget: "Box",
337
+ },
338
+ config: {
339
+ layout: 12,
340
+ main: {
341
+ heading: "Are you sure you want to delete ?",
342
+ },
343
+ style:{
344
+ marginTop: "-40px"
345
+ }
333
346
  },
334
- style:{
335
- marginTop: "-40px"
336
- }
337
- },
338
- },
339
- {
340
- type: "Control",
341
- scope: "#/properties/EmptyBox",
342
- options: {
343
- widget: "EmptyBox",
344
- },
345
- config: {
346
- main:{},
347
- layout: { xs: 11, sm: 5.5, md: 5.5, lg: 5.5 },
348
- },
349
- },
350
- {
351
- type: "Control",
352
- scope: "#/properties/ConfirmDeleteEventButton",
353
- options: {
354
- widget: "Button",
355
347
  },
356
- config: {
357
- layout: 3,
358
- main: {
359
- name: "Yes",
360
- startIcon: "ApproveIcon",
361
- variant: "contained",
362
- color: "info",
363
- type: "text",
364
- onClick: "deleteEvent",
365
- size: "small",
348
+ {
349
+ type: "Control",
350
+ scope: "#/properties/EmptyBox",
351
+ options: {
352
+ widget: "EmptyBox",
353
+ },
354
+ config: {
355
+ main:{},
356
+ layout: { xs: 11, sm: 5.5, md: 5.5, lg: 5.5 },
366
357
  },
367
358
  },
368
- },
369
- {
370
- type: "Control",
371
- scope: "#/properties/CancelDeleteEventButton",
372
- options: {
373
- widget: "Button",
359
+ {
360
+ type: "Control",
361
+ scope: "#/properties/ConfirmDeleteEventButton",
362
+ options: {
363
+ widget: "Button",
364
+ },
365
+ config: {
366
+ layout: 3,
367
+ main: {
368
+ name: "Yes",
369
+ startIcon: "ApproveIcon",
370
+ variant: "contained",
371
+ color: "info",
372
+ type: "text",
373
+ onClick: "deleteEvent",
374
+ size: "small",
375
+ },
376
+ },
374
377
  },
375
- config: {
376
- layout: 3,
377
- main: {
378
- name: "No",
379
- startIcon: "ApproveIcon",
380
- variant: "contained",
381
- color: "info",
382
- type: "text",
383
- onClick: "deletePopUpEvent",
384
- size: "small",
378
+ {
379
+ type: "Control",
380
+ scope: "#/properties/CancelDeleteEventButton",
381
+ options: {
382
+ widget: "Button",
383
+ },
384
+ config: {
385
+ layout: 3,
386
+ main: {
387
+ name: "No",
388
+ startIcon: "ApproveIcon",
389
+ variant: "contained",
390
+ color: "info",
391
+ type: "text",
392
+ onClick: "deletePopUpEvent",
393
+ size: "small",
394
+ },
385
395
  },
386
396
  },
387
- },
388
- ]
389
- },
397
+ ]
398
+ },
399
+
400
+ // {
401
+ // type: "Control",
402
+ // scope: "#/properties/popUpEventSection",
403
+ // options:{
404
+ // widget: "PopUp"
405
+ // },
406
+ // config:{
407
+ // layout: {
408
+ // xs: 12,
409
+ // sm: 12,
410
+ // md: 12,
411
+ // lg: 12,
412
+ // },
413
+ // main: {
414
+ // },
415
+ // },
416
+ // elemetns:[
417
+ // {
418
+ // type: "Control",
419
+ // scope: "#/properties/label",
420
+ // options: {
421
+ // widget: "Box",
422
+ // },
423
+ // config: {
424
+ // layout: 12,
425
+ // main: {
426
+ // heading: "Are you sure you want to delete ?",
427
+ // },
428
+ // style:{
429
+ // marginTop: "-40px"
430
+ // }
431
+ // },
432
+ // },
433
+ // {
434
+ // type: "Control",
435
+ // scope: "#/properties/EmptyBox",
436
+ // options: {
437
+ // widget: "EmptyBox",
438
+ // },
439
+ // config: {
440
+ // main:{},
441
+ // layout: { xs: 11, sm: 5.5, md: 5.5, lg: 5.5 },
442
+ // },
443
+ // },
444
+ // {
445
+ // type: "Control",
446
+ // scope: "#/properties/ConfirmDeleteEventButton",
447
+ // options: {
448
+ // widget: "Button",
449
+ // },
450
+ // config: {
451
+ // layout: 3,
452
+ // main: {
453
+ // name: "Yes",
454
+ // startIcon: "ApproveIcon",
455
+ // variant: "contained",
456
+ // color: "info",
457
+ // type: "text",
458
+ // onClick: "deleteEvent",
459
+ // size: "small",
460
+ // },
461
+ // },
462
+ // },
463
+ // {
464
+ // type: "Control",
465
+ // scope: "#/properties/CancelDeleteEventButton",
466
+ // options: {
467
+ // widget: "Button",
468
+ // },
469
+ // config: {
470
+ // layout: 3,
471
+ // main: {
472
+ // name: "No",
473
+ // startIcon: "ApproveIcon",
474
+ // variant: "contained",
475
+ // color: "info",
476
+ // type: "text",
477
+ // onClick: "deletePopUpEvent",
478
+ // size: "small",
479
+ // },
480
+ // },
481
+ // },
482
+ // ]
483
+ // },
390
484
 
391
485
  {
392
486
  type: "Control",
@@ -290,7 +290,7 @@ export const EventUiSchema: any = {
290
290
  widget: "Button",
291
291
  },
292
292
  config: {
293
- layout: 12,
293
+ layout: 3,
294
294
  main: {
295
295
  name: "Yes",
296
296
  startIcon: "ApproveIcon",
@@ -309,7 +309,7 @@ export const EventUiSchema: any = {
309
309
  widget: "Button",
310
310
  },
311
311
  config: {
312
- layout: 12,
312
+ layout: 3,
313
313
  main: {
314
314
  name: "No",
315
315
  startIcon: "ApproveIcon",
@@ -322,7 +322,99 @@ export const EventUiSchema: any = {
322
322
  },
323
323
  },
324
324
  ]
325
- },
325
+ },
326
+
327
+
328
+
329
+ // {
330
+ // type: "Control",
331
+ // scope: "#/properties/popUpEvent",
332
+ // options: {
333
+ // widget: "PopUp"
334
+ // },
335
+ // config: {
336
+ // layout: {
337
+ // xs: 12,
338
+ // sm: 12,
339
+ // md: 12,
340
+ // lg: 12,
341
+ // },
342
+ // main: {
343
+ // },
344
+ // },
345
+ // elements:
346
+ // [
347
+ // {
348
+ // type: "Control",
349
+ // scope: "#/properties/label",
350
+ // options: {
351
+ // widget: "Box",
352
+ // },
353
+ // config: {
354
+ // layout: 12,
355
+ // main: {
356
+ // heading: "Are you sure you want to delete ?",
357
+ // },
358
+ // style:{
359
+ // marginTop: "-40px"
360
+ // }
361
+ // },
362
+ // },
363
+ // {
364
+ // type: "Control",
365
+ // scope: "#/properties/EmptyBox",
366
+ // options: {
367
+ // widget: "EmptyBox",
368
+ // },
369
+ // config: {
370
+ // main:{},
371
+ // layout: { xs: 11, sm: 5.5, md: 5.5, lg: 5.5 },
372
+ // },
373
+ // },
374
+ // {
375
+ // type: "Control",
376
+ // scope: "#/properties/ConfirmDeleteEventButton",
377
+ // options: {
378
+ // widget: "Button",
379
+ // },
380
+ // config: {
381
+ // layout: 12,
382
+ // main: {
383
+ // name: "Yes",
384
+ // startIcon: "ApproveIcon",
385
+ // variant: "contained",
386
+ // color: "info",
387
+ // type: "text",
388
+ // onClick: "deleteEvent",
389
+ // size: "small",
390
+ // },
391
+ // },
392
+ // },
393
+ // {
394
+ // type: "Control",
395
+ // scope: "#/properties/CancelDeleteEventButton",
396
+ // options: {
397
+ // widget: "Button",
398
+ // },
399
+ // config: {
400
+ // layout: 12,
401
+ // main: {
402
+ // name: "No",
403
+ // startIcon: "ApproveIcon",
404
+ // variant: "contained",
405
+ // color: "info",
406
+ // type: "text",
407
+ // onClick: "deletePopUpEvent",
408
+ // size: "small",
409
+ // },
410
+ // },
411
+ // },
412
+ // ]
413
+ // },
414
+
415
+
416
+
417
+
326
418
  {
327
419
  type: "Control",
328
420
  scope: "#/properties/proc",
@@ -104,22 +104,32 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
104
104
  store.navigate(`/Component?path=${`elements[${rowId}]`}&id=${id}`)
105
105
  }
106
106
  },
107
- deleteComponents: function () {
107
+ deleteComponents: function (shouldUpdateDialog: boolean = true) {
108
108
  const path = store.searchParams?.get("path");
109
- const rowId = dynamicData.path.split(".")[1];
109
+ // const rowId = dynamicData.path.split(".")[1];
110
+ const rowId = localStorage.getItem('rowId');
110
111
  store.formData.elements.splice(rowId, 1);
111
112
  const response = saveFormdataInLocalStorage(store.ctx.core.data, path)
112
113
  const data = path ? _.get(response, path) : response;
113
114
  store.setFormdata(data);
114
115
  // store.updateDialog("popUpComponent");
116
+ if(shouldUpdateDialog){
117
+ store.updateDialog("popUpComponentSection");
118
+ }
119
+ localStorage.removeItem('rowId');
115
120
  },
116
- deleteEvent: function () {
121
+ deleteEvent: function (shouldUpdateDialog: boolean = true) {
117
122
  const path = store.searchParams?.get("path");
118
- const rowId = dynamicData.path.split(".")[1];
123
+ const rowId = localStorage.getItem('rowId');
124
+ // const rowId = dynamicData.path.split(".")[1];
119
125
  store.formData.events.splice(rowId, 1);
120
126
  const response = saveFormdataInLocalStorage(store.ctx.core.data, path)
121
127
  store.setFormdata(_.get(response, path));
122
128
  // store.updateDialog("popUpEvent")
129
+ if(shouldUpdateDialog){
130
+ store.updateDialog("popUpEventSection")
131
+ }
132
+ localStorage.removeItem('rowId');
123
133
  },
124
134
  widgetAddClickHandler: function () {
125
135
  if (!Array.isArray(store.formData.elements)) {
@@ -155,9 +165,13 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
155
165
  store.navigate(-1)
156
166
  },
157
167
  deletePopUpComponent: function(){
168
+ const rowId = dynamicData.path.split(".")[1];
169
+ localStorage.setItem('rowId',rowId);
158
170
  store.updateDialog("popUpComponentSection");
159
171
  },
160
172
  deletePopUpEvent: function(){
173
+ const rowId = dynamicData.path.split(".")[1];
174
+ localStorage.setItem('rowId',rowId);
161
175
  store.updateDialog("popUpEventSection");
162
176
  },
163
177
  }
@@ -90,13 +90,15 @@ export default (
90
90
 
91
91
  },
92
92
  deleteEvent: async function () {
93
- await Component(store, dynamicData, submitHandler, service).deleteEvent;
93
+ await Component(store, dynamicData, submitHandler, service).deleteEvent(false);
94
94
  store.updateDialog("popUpEvent");
95
95
  },
96
96
  backHandler: function () {
97
97
  store.navigate(-1)
98
98
  },
99
99
  deletePopUpEvent: function(){
100
+ const rowId = dynamicData.path.split(".")[1];
101
+ localStorage.setItem('rowId',rowId);
100
102
  store.updateDialog("popUpEvent");
101
103
  }
102
104
  }
@@ -57,7 +57,7 @@ export default (funcParams: funcParamsProps) => {
57
57
  Edit_Components: Component(store, dynamicData, submitHandler, service).editComponents,
58
58
  // Delete_Components: Component(store, dynamicData, submitHandler, service).deleteComponents,
59
59
  Delete_Components: async function() {
60
- await Component(store, dynamicData, submitHandler, service).deleteComponents();
60
+ await Component(store, dynamicData, submitHandler, service).deleteComponents(false);
61
61
  store.updateDialog("popUpPageMasterComponent");
62
62
  },
63
63
  eventAddHandler: function () {
@@ -77,17 +77,22 @@ export default (funcParams: funcParamsProps) => {
77
77
  store.navigate(`/ComponentEvents?path=${finalPath}&id=${id}`)
78
78
  },
79
79
  deleteEvent: function () {
80
- const rowId = dynamicData.path.split(".")[1];
80
+ const rowId = localStorage.getItem('rowId');
81
+ // const rowId = dynamicData.path.split(".")[1];
81
82
  store.formData.events.splice(rowId, 1);
82
83
  const response = saveFormdataInLocalStorage(store.ctx.core.data)
83
84
  store.setFormdata(response);
84
85
  store.updateDialog("popUpPageMasterEvent");
86
+ localStorage.removeItem('rowId');
85
87
  },
86
88
  deletePopUpComponent: function(){
87
89
  const rowId = dynamicData.path.split(".")[1];
90
+ localStorage.setItem('rowId',rowId);
88
91
  store.updateDialog("popUpPageMasterComponent");
89
92
  },
90
93
  deletePopUpEvent: function(){
94
+ const rowId = dynamicData.path.split(".")[1];
95
+ localStorage.setItem('rowId',rowId);
91
96
  store.updateDialog("popUpPageMasterEvent");
92
97
  },
93
98
  }