impaktapps-ui-builder 0.0.963-copyElement.1013 → 0.0.963-copyElement.1014

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "impaktapps-ui-builder",
3
- "version": "0.0.963-copyElement.1013",
3
+ "version": "0.0.963-copyElement.1014",
4
4
  "scripts": {
5
5
  "dev": "vite",
6
6
  "build": "tsc && vite build",
@@ -178,6 +178,105 @@ export const componentBasicUiSchema: any = (theme)=>{
178
178
  },
179
179
  ],
180
180
  },
181
+
182
+ {
183
+ type: "HorizontalLayout",
184
+ config: {
185
+ layout:{xs:12,sm: 6}
186
+ },
187
+ elements: [
188
+ {
189
+ type: "Control",
190
+ scope: "#/properties/RemoveItemButton",
191
+ options: {
192
+ widget: "IconButton",
193
+ },
194
+ config: {
195
+ layout: { xs: 1, sm: 1 },
196
+ main: {
197
+ onClick: "RemoveItemButton",
198
+ size: "large",
199
+ icon: "RejectIcon",
200
+ styleDefault: true,
201
+ },
202
+ style:{
203
+ marginLeft: "-10px"
204
+ }
205
+ },
206
+ },
207
+
208
+ {
209
+ type: "Control",
210
+ scope: "#/properties/copiedElementDetails",
211
+
212
+ options: {
213
+ widget: "Box",
214
+ },
215
+ config: {
216
+ layout: { xs: 6, sm: 6 },
217
+ main: {
218
+ heading: "No element copied",
219
+ },
220
+ style: {
221
+ color: "#535557",
222
+ marginLeft: "-10px"
223
+ },
224
+ },
225
+ },
226
+ {
227
+ type: "Control",
228
+ scope: "#/properties/EmptyBox",
229
+ options: {
230
+ widget: "EmptyBox",
231
+ },
232
+ config: {
233
+ layout: { xs: 1, sm: 5 },
234
+ },
235
+ },
236
+ ]
237
+ },
238
+ {
239
+ type: "Control",
240
+ scope: "#/properties/btn",
241
+ options: {
242
+ widget: "Button",
243
+ },
244
+
245
+ config: {
246
+ layout: { xs: 4, sm: 2 },
247
+ main: {
248
+ name: "Ok",
249
+ startIcon: "ApproveIcon",
250
+ variant: "contained",
251
+ // color: "info",
252
+ type: "text",
253
+ onClick: "okHandler",
254
+ size: "medium",
255
+ },
256
+ },
257
+ },
258
+ {
259
+ type: "Control",
260
+ scope: "#/properties/btnSubmit",
261
+ options: {
262
+ widget: "Button",
263
+ },
264
+
265
+ config: {
266
+ layout: { xs: 4, sm: 2 },
267
+ main: {
268
+ name: "Save & Exit",
269
+ startIcon: "ApproveIcon",
270
+ variant: "contained",
271
+ // color: "info",
272
+ type: "text",
273
+ onClick: "saveHandler",
274
+ size: "medium",
275
+ },
276
+ },
277
+ },
278
+
279
+
181
280
  {
182
281
  type: "Control",
183
282
  scope: "#/properties/popUpComponentSection",
@@ -367,102 +466,6 @@ export const componentBasicUiSchema: any = (theme)=>{
367
466
 
368
467
  //////////////////////////////////////
369
468
 
370
- {
371
- type: "HorizontalLayout",
372
- config: {
373
- layout:{xs:12,sm: 6}
374
- },
375
- elements: [
376
- {
377
- type: "Control",
378
- scope: "#/properties/RemoveItemButton",
379
- options: {
380
- widget: "IconButton",
381
- },
382
- config: {
383
- layout: { xs: 1, sm: 1 },
384
- main: {
385
- onClick: "RemoveItemButton",
386
- size: "large",
387
- icon: "RejectIcon",
388
- styleDefault: true,
389
- },
390
- style:{
391
- marginLeft: "-10px"
392
- }
393
- },
394
- },
395
-
396
- {
397
- type: "Control",
398
- scope: "#/properties/copiedElementDetails",
399
-
400
- options: {
401
- widget: "Box",
402
- },
403
- config: {
404
- layout: { xs: 6, sm: 6 },
405
- main: {
406
- heading: "No element copied",
407
- },
408
- style: {
409
- color: "#a1a09d",
410
- marginLeft: "-10px"
411
- },
412
- },
413
- },
414
- {
415
- type: "Control",
416
- scope: "#/properties/EmptyBox",
417
- options: {
418
- widget: "EmptyBox",
419
- },
420
- config: {
421
- layout: { xs: 1, sm: 5 },
422
- },
423
- },
424
- ]
425
- },
426
- {
427
- type: "Control",
428
- scope: "#/properties/btn",
429
- options: {
430
- widget: "Button",
431
- },
432
-
433
- config: {
434
- layout: { xs: 4, sm: 2 },
435
- main: {
436
- name: "Ok",
437
- startIcon: "ApproveIcon",
438
- variant: "contained",
439
- // color: "info",
440
- type: "text",
441
- onClick: "okHandler",
442
- size: "medium",
443
- },
444
- },
445
- },
446
- {
447
- type: "Control",
448
- scope: "#/properties/btnSubmit",
449
- options: {
450
- widget: "Button",
451
- },
452
-
453
- config: {
454
- layout: { xs: 4, sm: 2 },
455
- main: {
456
- name: "Save & Exit",
457
- startIcon: "ApproveIcon",
458
- variant: "contained",
459
- // color: "info",
460
- type: "text",
461
- onClick: "saveHandler",
462
- size: "medium",
463
- },
464
- },
465
- },
466
469
  {
467
470
  type: "Control",
468
471
  scope: "#/properties/notify",
@@ -255,7 +255,7 @@ export const EventUiSchema: any = (theme) => {
255
255
  heading: "No element copied",
256
256
  },
257
257
  style: {
258
- color: "#a1a09d",
258
+ color: "#535557",
259
259
  marginLeft: "-10px"
260
260
  },
261
261
  },
@@ -203,7 +203,7 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
203
203
 
204
204
  const formData = getFormdataFromSessionStorage(copiedComponentPath);
205
205
 
206
- uiSchema.elements[4].elements[1].config.main.heading = `Copied Element: ${formData.name}`;
206
+ uiSchema.elements[2].elements[1].config.main.heading = `Copied Element: ${formData.name}`;
207
207
 
208
208
  sessionStorage.setItem('copiedConfig',JSON.stringify(formData));
209
209
 
@@ -213,29 +213,38 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
213
213
  },
214
214
 
215
215
  PasteComponent: function(paramStore = store, setPage = this.setPage.bind(this)){
216
- // const schema = cloneDeep(store.schema);
217
-
218
- const path = store.searchParams?.get("path");
219
- const rowId = dynamicData.path.split(".")[1];
220
-
221
- const formData = getFormdataFromSessionStorage(path)
222
- const insertComponentPath = formData.elements.length;
223
- // const finalPath = `${path}.elements[${insertComponentPath}]`;
224
-
225
- const finalPath = path ? `${path}.elements[${insertComponentPath}]` : `elements[${insertComponentPath}]`;
226
-
227
- const copiedData = JSON.parse(sessionStorage.getItem("copiedConfig"));
228
- if(copiedData.Handler){
216
+ if (!sessionStorage.getItem("copiedConfig") ) {
229
217
  store.setNotify({
230
- FailMessage: "Pasting element not Valid",
218
+ FailMessage: "No item has been copied.",
231
219
  Fail: true,
232
220
  });
233
221
  }
234
222
  else{
235
- saveFormdataInSessionStorage(copiedData, finalPath);
236
- // sessionStorage.removeItem('copiedConfig');
237
- setPage();
223
+ const path = store.searchParams?.get("path");
224
+ const rowId = dynamicData.path.split(".")[1];
225
+
226
+ const formData = getFormdataFromSessionStorage(path)
227
+ const insertComponentPath = formData.elements.length;
228
+ // const finalPath = `${path}.elements[${insertComponentPath}]`;
229
+
230
+ const finalPath = path ? `${path}.elements[${insertComponentPath}]` : `elements[${insertComponentPath}]`;
231
+
232
+ const copiedData = JSON.parse(sessionStorage.getItem("copiedConfig"));
233
+ if(copiedData.Handler){
234
+ store.setNotify({
235
+ FailMessage: "Pasting element not Valid",
236
+ Fail: true,
237
+ });
238
+ }
239
+ else{
240
+ saveFormdataInSessionStorage(copiedData, finalPath);
241
+ // sessionStorage.removeItem('copiedConfig');
242
+ setPage();
243
+ }
238
244
  }
245
+ // const schema = cloneDeep(store.schema);
246
+
247
+
239
248
  },
240
249
 
241
250
  RemoveItemButton: function(paramStore = store){
@@ -244,7 +253,6 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
244
253
  schema.properties.RemoveItemButton.disabled = true;
245
254
  // schema.properties.Paste_Icon.disabled = true;
246
255
  sessionStorage.removeItem('copiedConfig');
247
-
248
256
  store.setSchema(schema);
249
257
  store.setUiSchema(uiSchema);
250
258
  },