impaktapps-ui-builder 0.0.963-CopyComponent.6 → 0.0.963-CopyComponent.7

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.
@@ -9,7 +9,7 @@ export declare const EventSection: (theme: any) => {
9
9
  config: {
10
10
  main: {
11
11
  headerIcons: {
12
- elements: {
12
+ elements: ({
13
13
  widget: {
14
14
  type: string;
15
15
  scope: string;
@@ -30,7 +30,28 @@ export declare const EventSection: (theme: any) => {
30
30
  };
31
31
  };
32
32
  };
33
- }[];
33
+ } | {
34
+ widget: {
35
+ type: string;
36
+ scope: string;
37
+ options: {
38
+ widget: string;
39
+ };
40
+ config: {
41
+ main: {
42
+ onClick: string;
43
+ size: string;
44
+ icon: string;
45
+ iconLabel: string;
46
+ styleDefault: boolean;
47
+ color?: undefined;
48
+ };
49
+ style: {
50
+ mt: string;
51
+ };
52
+ };
53
+ };
54
+ })[];
34
55
  };
35
56
  disableAction: boolean;
36
57
  disableSelection: boolean;
@@ -9,7 +9,7 @@ export declare const TableSection: (theme: any) => {
9
9
  config: {
10
10
  main: {
11
11
  headerIcons: {
12
- elements: {
12
+ elements: ({
13
13
  widget: {
14
14
  type: string;
15
15
  scope: string;
@@ -30,7 +30,28 @@ export declare const TableSection: (theme: any) => {
30
30
  };
31
31
  };
32
32
  };
33
- }[];
33
+ } | {
34
+ widget: {
35
+ type: string;
36
+ scope: string;
37
+ options: {
38
+ widget: string;
39
+ };
40
+ config: {
41
+ main: {
42
+ onClick: string;
43
+ size: string;
44
+ icon: string;
45
+ iconLabel: string;
46
+ styleDefault: boolean;
47
+ color?: undefined;
48
+ };
49
+ style: {
50
+ mt: string;
51
+ };
52
+ };
53
+ };
54
+ })[];
34
55
  };
35
56
  disableAction: boolean;
36
57
  disableSelection: boolean;
@@ -101,8 +122,8 @@ export declare const TableSection: (theme: any) => {
101
122
  main: {
102
123
  icon: string;
103
124
  onClick: string;
104
- tooltipMessage: string;
105
125
  color?: undefined;
126
+ tooltipMessage?: undefined;
106
127
  };
107
128
  style?: undefined;
108
129
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "impaktapps-ui-builder",
3
- "version": "0.0.963-CopyComponent.6",
3
+ "version": "0.0.963-CopyComponent.7",
4
4
  "scripts": {
5
5
  "dev": "vite",
6
6
  "build": "tsc && vite build",
@@ -35,6 +35,30 @@ export const EventSection = (theme)=>{
35
35
  },
36
36
  }
37
37
  },
38
+
39
+ {
40
+ widget: {
41
+ type: "Control",
42
+ scope: "#/properties/Paste_Icon",
43
+
44
+ options: {
45
+ widget: "IconButton",
46
+ },
47
+ config: {
48
+ main: {
49
+ // color: "info",
50
+ onClick: "PasteEvent",
51
+ size: "small",
52
+ icon: "SendIcon",
53
+ iconLabel: "Paste",
54
+ styleDefault: true,
55
+ },
56
+ style: {
57
+ mt: "6px",
58
+ },
59
+ },
60
+ }
61
+ },
38
62
  ]
39
63
  },
40
64
  disableAction: true,
@@ -35,6 +35,31 @@ export const TableSection = (theme) => {
35
35
  },
36
36
  }
37
37
  },
38
+
39
+
40
+ {
41
+ widget: {
42
+ type: "Control",
43
+ scope: "#/properties/Paste_Icon",
44
+
45
+ options: {
46
+ widget: "IconButton",
47
+ },
48
+ config: {
49
+ main: {
50
+ // color: "info",
51
+ onClick: "PasteComponent",
52
+ size: "small",
53
+ icon: "SendIcon",
54
+ iconLabel: "Paste",
55
+ styleDefault: true,
56
+ },
57
+ style: {
58
+ mt: "6px",
59
+ },
60
+ },
61
+ }
62
+ },
38
63
  ]
39
64
  },
40
65
  disableAction: true,
@@ -100,11 +125,11 @@ export const TableSection = (theme) => {
100
125
 
101
126
  {
102
127
  header: "Copy",
103
- field: "Copy_Component2",
128
+ field: "Copy_Component",
104
129
  flex: 1,
105
130
  widget: {
106
131
  type: "Control",
107
- scope: "#/properties/CopyComponent2",
132
+ scope: "#/properties/CopyComponent",
108
133
  options: {
109
134
  widget: "IconButton",
110
135
  },
@@ -113,32 +138,12 @@ export const TableSection = (theme) => {
113
138
  icon: "FileCopyIcon",
114
139
  // color: "error",
115
140
  onClick: "CopyComponent",
116
- tooltipMessage: "Reject This Record",
117
141
  },
118
142
  },
119
143
  },
120
144
  },
121
145
 
122
- {
123
- header: "paste",
124
- field: "Paste_Component2",
125
- flex: 1,
126
- widget: {
127
- type: "Control",
128
- scope: "#/properties/PasteComponent2",
129
- options: {
130
- widget: "IconButton",
131
- },
132
- config: {
133
- main: {
134
- icon: "SendIcon",
135
- // color: "error",
136
- onClick: "PasteComponent",
137
- tooltipMessage: "Reject This Record",
138
- },
139
- },
140
- },
141
- },
146
+
142
147
  ]
143
148
  }]
144
149
  }
@@ -127,6 +127,30 @@ export const PageMasterUiSchema: any = (theme) => {
127
127
  },
128
128
  }
129
129
  },
130
+
131
+ {
132
+ widget: {
133
+ type: "Control",
134
+ scope: "#/properties/Paste_Icon",
135
+
136
+ options: {
137
+ widget: "IconButton",
138
+ },
139
+ config: {
140
+ main: {
141
+ // color: "info",
142
+ onClick: "PasteComponent",
143
+ size: "small",
144
+ icon: "SendIcon",
145
+ iconLabel: "Paste",
146
+ styleDefault: true,
147
+ },
148
+ style: {
149
+ mt: "6px",
150
+ },
151
+ },
152
+ }
153
+ },
130
154
  ]
131
155
  },
132
156
  disableAction: true,
@@ -204,33 +228,12 @@ export const PageMasterUiSchema: any = (theme) => {
204
228
  icon: "FileCopyIcon",
205
229
  // color: "error",
206
230
  onClick: "CopyComponent",
207
- tooltipMessage: "Reject This Record",
208
- },
209
- },
210
- },
211
- },
212
-
213
- {
214
- header: "paste",
215
- field: "Paste_Component",
216
- flex: 1,
217
- widget: {
218
- type: "Control",
219
- scope: "#/properties/PasteComponent",
220
- options: {
221
- widget: "IconButton",
222
- },
223
- config: {
224
- main: {
225
- icon: "SendIcon",
226
- // color: "error",
227
- onClick: "PasteComponent",
228
- tooltipMessage: "Reject This Record",
229
231
  },
230
232
  },
231
233
  },
232
234
  },
233
235
 
236
+
234
237
  ]
235
238
  },
236
239
  {
@@ -266,6 +269,30 @@ export const PageMasterUiSchema: any = (theme) => {
266
269
  },
267
270
  }
268
271
  },
272
+
273
+ {
274
+ widget: {
275
+ type: "Control",
276
+ scope: "#/properties/Paste_Icon",
277
+
278
+ options: {
279
+ widget: "IconButton",
280
+ },
281
+ config: {
282
+ main: {
283
+ // color: "info",
284
+ onClick: "PasteEvent",
285
+ size: "small",
286
+ icon: "SendIcon",
287
+ iconLabel: "Paste",
288
+ styleDefault: true,
289
+ },
290
+ style: {
291
+ mt: "6px",
292
+ },
293
+ },
294
+ }
295
+ },
269
296
  ]
270
297
  },
271
298
 
@@ -327,6 +354,27 @@ export const PageMasterUiSchema: any = (theme) => {
327
354
  },
328
355
  },
329
356
  },
357
+
358
+
359
+ {
360
+ header: "Copy",
361
+ field: "Copy_Event",
362
+ flex: 1,
363
+ widget: {
364
+ type: "Control",
365
+ scope: "#/properties/CopyEvent",
366
+ options: {
367
+ widget: "IconButton",
368
+ },
369
+ config: {
370
+ main: {
371
+ icon: "FileCopyIcon",
372
+ // color: "error",
373
+ onClick: "CopyEvent",
374
+ },
375
+ },
376
+ },
377
+ },
330
378
  ]
331
379
  // }]
332
380
  },
@@ -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_Icon",
114
+
115
+ options: {
116
+ widget: "IconButton",
117
+ },
118
+ config: {
119
+ main: {
120
+ // color: "info",
121
+ onClick: "PasteEvent",
122
+ size: "small",
123
+ icon: "SendIcon",
124
+ iconLabel: "Paste",
125
+ styleDefault: true,
126
+ },
127
+ style: {
128
+ mt: "6px",
129
+ },
130
+ },
131
+ }
132
+ },
109
133
  ]
110
134
  },
111
135
  disableAction: true,
@@ -169,11 +193,11 @@ export const EventUiSchema: any = (theme) => {
169
193
 
170
194
  {
171
195
  header: "Copy",
172
- field: "Copy_Event2",
196
+ field: "Copy_Event",
173
197
  flex: 1,
174
198
  widget: {
175
199
  type: "Control",
176
- scope: "#/properties/CopyEvent2",
200
+ scope: "#/properties/CopyEvent",
177
201
  options: {
178
202
  widget: "IconButton",
179
203
  },
@@ -182,28 +206,6 @@ export const EventUiSchema: any = (theme) => {
182
206
  icon: "FileCopyIcon",
183
207
  // color: "error",
184
208
  onClick: "CopyEvent",
185
- tooltipMessage: "Reject This Record",
186
- },
187
- },
188
- },
189
- },
190
-
191
- {
192
- header: "paste",
193
- field: "Paste_Event2",
194
- flex: 1,
195
- widget: {
196
- type: "Control",
197
- scope: "#/properties/PasteEvent2",
198
- options: {
199
- widget: "IconButton",
200
- },
201
- config: {
202
- main: {
203
- icon: "SendIcon",
204
- // color: "error",
205
- onClick: "PasteEvent",
206
- tooltipMessage: "Reject This Record",
207
209
  },
208
210
  },
209
211
  },
@@ -173,67 +173,132 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
173
173
  store.updateDialog("popUpEventSection");
174
174
  },
175
175
 
176
-
176
+
177
177
  CopyComponent: function(){
178
178
  const rowId = dynamicData.path.split(".")[1];
179
- const path = store.searchParams?.get("path");
180
-
181
- // const updatedPath = `${path}.elements[${rowId}]`;
182
- const updatedPath = path ? `${path}.elements[${rowId}]` : `elements[${rowId}]`;
179
+ const parentPathOfCopiedComponent = store.searchParams?.get("path");
180
+ const copiedComponentPath = parentPathOfCopiedComponent ? `${parentPathOfCopiedComponent}.elements[${rowId}]` : `elements[${rowId}]`;
183
181
 
184
- const formData = getFormdataFromSessionStorage(updatedPath);
185
- // sessionStorage.setItem('copiedComponent',formData);
186
- sessionStorage.setItem('copiedComponent',JSON.stringify(formData));
182
+ const formData = getFormdataFromSessionStorage(copiedComponentPath);
183
+ sessionStorage.setItem('copiedConfig',JSON.stringify(formData));
187
184
 
188
185
  },
189
-
186
+
190
187
  PasteComponent: function(){
191
188
  const path = store.searchParams?.get("path");
192
- const rowId = dynamicData.path.split(".")[1];
193
- // const updatedPath = `${path}.elements[${rowId}]`;
194
- const updatedPath = path ? `${path}.elements[${rowId}]` : `elements[${rowId}]`;
195
- const formData = getFormdataFromSessionStorage(updatedPath)
189
+ const formData = getFormdataFromSessionStorage(path)
196
190
  const insertComponentPath = formData.elements.length;
197
191
 
198
- const finalPath = `${updatedPath}.elements[${insertComponentPath}]`;
199
-
200
- // const copiedData = sessionStorage.getItem('copiedComponent');
201
- const copiedData = JSON.parse(sessionStorage.getItem("copiedComponent"));
192
+ const finalPath = `${path}.elements[${insertComponentPath}]`;
193
+ const copiedData = JSON.parse(sessionStorage.getItem("copiedConfig"));
194
+ if(!copiedData.elements){
195
+ store.setNotify({
196
+ FailMessage: "Pasting not Valid",
197
+ Fail: true,
198
+ });
199
+ }
202
200
  saveFormdataInSessionStorage(copiedData, finalPath);
203
- sessionStorage.removeItem('copiedComponent');
201
+ sessionStorage.removeItem('copiedConfig');
204
202
  this.setPage();
205
-
206
203
  },
207
204
 
208
205
 
209
206
  CopyEvent: function(){
210
207
  const rowId = dynamicData.path.split(".")[1];
211
208
  const path = store.searchParams?.get("path");
212
-
213
- // const updatedPath = `${path}.elements[${rowId}]`;
214
209
  const updatedPath = path ? `${path}.events[${rowId}]` : `events[${rowId}]`;
215
210
 
216
211
  const formData = getFormdataFromSessionStorage(updatedPath);
217
- // sessionStorage.setItem('copiedComponent',formData);
218
- sessionStorage.setItem('copiedComponent',JSON.stringify(formData));
212
+ sessionStorage.setItem('copiedConfig',JSON.stringify(formData));
219
213
  },
220
214
 
221
215
  PasteEvent: function(){
222
216
  const path = store.searchParams?.get("path");
223
- const rowId = dynamicData.path.split(".")[1];
224
- // const updatedPath = `${path}.elements[${rowId}]`;
225
- const updatedPath = path ? `${path}.events[${rowId}]` : `events[${rowId}]`;
226
- const formData = getFormdataFromSessionStorage(updatedPath)
227
- const insertComponentPath = formData.elements.length;
217
+ const formData = getFormdataFromSessionStorage(path)
218
+ const insertComponentPath = formData.events.length;
228
219
 
229
- const finalPath = `${updatedPath}.events[${insertComponentPath}]`;
220
+ const finalPath = `${path}.events[${insertComponentPath}]`;
230
221
 
231
- // const copiedData = sessionStorage.getItem('copiedComponent');
232
- const copiedData = JSON.parse(sessionStorage.getItem("copiedComponent"));
222
+ const copiedData = JSON.parse(sessionStorage.getItem("copiedConfig"));
223
+ if(!copiedData.events){
224
+ store.setNotify({
225
+ FailMessage: "Pasting not Valid",
226
+ Fail: true,
227
+ });
228
+ }
233
229
  saveFormdataInSessionStorage(copiedData, finalPath);
234
- sessionStorage.removeItem('copiedComponent');
230
+ sessionStorage.removeItem('copiedConfig');
235
231
  this.setPage();
236
232
  }
237
233
 
234
+
235
+
236
+
237
+
238
+
239
+
240
+
241
+ // CopyComponent: function(){
242
+ // const rowId = dynamicData.path.split(".")[1];
243
+ // const path = store.searchParams?.get("path");
244
+
245
+ // // const updatedPath = `${path}.elements[${rowId}]`;
246
+ // const updatedPath = path ? `${path}.elements[${rowId}]` : `elements[${rowId}]`;
247
+
248
+ // const formData = getFormdataFromSessionStorage(updatedPath);
249
+ // // sessionStorage.setItem('copiedComponent',formData);
250
+ // sessionStorage.setItem('copiedComponent',JSON.stringify(formData));
251
+
252
+ // },
253
+
254
+ // PasteComponent: function(){
255
+ // const path = store.searchParams?.get("path");
256
+ // const rowId = dynamicData.path.split(".")[1];
257
+ // // const updatedPath = `${path}.elements[${rowId}]`;
258
+ // const updatedPath = path ? `${path}.elements[${rowId}]` : `elements[${rowId}]`;
259
+ // const formData = getFormdataFromSessionStorage(updatedPath)
260
+ // const insertComponentPath = formData.elements.length;
261
+
262
+ // const finalPath = `${updatedPath}.elements[${insertComponentPath}]`;
263
+
264
+ // // const copiedData = sessionStorage.getItem('copiedComponent');
265
+ // const copiedData = JSON.parse(sessionStorage.getItem("copiedComponent"));
266
+ // saveFormdataInSessionStorage(copiedData, finalPath);
267
+ // sessionStorage.removeItem('copiedComponent');
268
+ // this.setPage();
269
+
270
+ // },
271
+
272
+
273
+
274
+ // CopyEvent: function(){
275
+ // const rowId = dynamicData.path.split(".")[1];
276
+ // const path = store.searchParams?.get("path");
277
+
278
+ // // const updatedPath = `${path}.elements[${rowId}]`;
279
+ // const updatedPath = path ? `${path}.events[${rowId}]` : `events[${rowId}]`;
280
+
281
+ // const formData = getFormdataFromSessionStorage(updatedPath);
282
+ // // sessionStorage.setItem('copiedComponent',formData);
283
+ // sessionStorage.setItem('copiedComponent',JSON.stringify(formData));
284
+ // },
285
+
286
+ // PasteEvent: function(){
287
+ // const path = store.searchParams?.get("path");
288
+ // const rowId = dynamicData.path.split(".")[1];
289
+ // // const updatedPath = `${path}.elements[${rowId}]`;
290
+ // const updatedPath = path ? `${path}.elements[${rowId}]` : `elements[${rowId}]`;
291
+ // const formData = getFormdataFromSessionStorage(updatedPath)
292
+ // const insertComponentPath = formData.elements.length;
293
+
294
+ // const finalPath = `${updatedPath}.events[${insertComponentPath}]`;
295
+
296
+ // // const copiedData = sessionStorage.getItem('copiedComponent');
297
+ // const copiedData = JSON.parse(sessionStorage.getItem("copiedComponent"));
298
+ // saveFormdataInSessionStorage(copiedData, finalPath);
299
+ // sessionStorage.removeItem('copiedComponent');
300
+ // this.setPage();
301
+ // }
302
+
238
303
  }
239
304
  };
@@ -143,29 +143,21 @@ export default (
143
143
  CopyEvent: function(){
144
144
  const rowId = dynamicData.path.split(".")[1];
145
145
  const path = store.searchParams?.get("path");
146
-
147
- // const updatedPath = `${path}.elements[${rowId}]`;
148
146
  const updatedPath = path ? `${path}.events[${rowId}]` : `events[${rowId}]`;
149
147
 
150
148
  const formData = getFormdataFromSessionStorage(updatedPath);
151
- // sessionStorage.setItem('copiedComponent',formData);
152
- sessionStorage.setItem('copiedComponent',JSON.stringify(formData));
149
+ sessionStorage.setItem('copiedConfig',JSON.stringify(formData));
153
150
  },
154
151
 
155
152
  PasteEvent: function(){
156
153
  const path = store.searchParams?.get("path");
157
- const rowId = dynamicData.path.split(".")[1];
158
- // const updatedPath = `${path}.elements[${rowId}]`;
159
- const updatedPath = path ? `${path}.events[${rowId}]` : `events[${rowId}]`;
160
- const formData = getFormdataFromSessionStorage(updatedPath)
161
- const insertComponentPath = formData.elements.length;
162
-
163
- const finalPath = `${updatedPath}.events[${insertComponentPath}]`;
154
+ const formData = getFormdataFromSessionStorage(path)
155
+ const insertComponentPath = formData.events.length;
164
156
 
165
- // const copiedData = sessionStorage.getItem('copiedComponent');
166
- const copiedData = JSON.parse(sessionStorage.getItem("copiedComponent"));
157
+ const finalPath = `${path}.events[${insertComponentPath}]`;
158
+ const copiedData = JSON.parse(sessionStorage.getItem("copiedConfig"));
167
159
  saveFormdataInSessionStorage(copiedData, finalPath);
168
- sessionStorage.removeItem('copiedComponent');
160
+ sessionStorage.removeItem('copiedConfig');
169
161
  this.setPage();
170
162
  }
171
163
  }