impaktapps-ui-builder 0.0.963-copyElement.1012 → 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/dist/impaktapps-ui-builder.es.js +119 -104
- package/dist/impaktapps-ui-builder.es.js.map +1 -1
- package/dist/impaktapps-ui-builder.umd.js +3 -3
- package/dist/impaktapps-ui-builder.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/impaktapps-ui-builder/builder/elements/UiSchema/Component/uiSchema.ts +99 -96
- package/src/impaktapps-ui-builder/builder/elements/UiSchema/event/uiSchema.ts +1 -1
- package/src/impaktapps-ui-builder/builder/services/component.ts +32 -20
- package/src/impaktapps-ui-builder/builder/services/pageMaster.ts +5 -1
package/package.json
CHANGED
|
@@ -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",
|
|
@@ -83,7 +83,11 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
|
|
|
83
83
|
return getFormdataFromSessionStorage(path)
|
|
84
84
|
},
|
|
85
85
|
getSchema: function () {
|
|
86
|
-
|
|
86
|
+
const schema = _.cloneDeep(ComponentSchema);
|
|
87
|
+
if (sessionStorage.getItem("copiedConfig") ) {
|
|
88
|
+
schema.properties.RemoveItemButton.disabled = false;
|
|
89
|
+
}
|
|
90
|
+
return schema;
|
|
87
91
|
},
|
|
88
92
|
okHandler: () => okHandler(store),
|
|
89
93
|
saveHandler: async () => await saveHandler(store, service, submitHandler, "PageMaster"),
|
|
@@ -199,7 +203,7 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
|
|
|
199
203
|
|
|
200
204
|
const formData = getFormdataFromSessionStorage(copiedComponentPath);
|
|
201
205
|
|
|
202
|
-
uiSchema.elements[
|
|
206
|
+
uiSchema.elements[2].elements[1].config.main.heading = `Copied Element: ${formData.name}`;
|
|
203
207
|
|
|
204
208
|
sessionStorage.setItem('copiedConfig',JSON.stringify(formData));
|
|
205
209
|
|
|
@@ -209,29 +213,38 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
|
|
|
209
213
|
},
|
|
210
214
|
|
|
211
215
|
PasteComponent: function(paramStore = store, setPage = this.setPage.bind(this)){
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
const path = store.searchParams?.get("path");
|
|
215
|
-
const rowId = dynamicData.path.split(".")[1];
|
|
216
|
-
|
|
217
|
-
const formData = getFormdataFromSessionStorage(path)
|
|
218
|
-
const insertComponentPath = formData.elements.length;
|
|
219
|
-
// const finalPath = `${path}.elements[${insertComponentPath}]`;
|
|
220
|
-
|
|
221
|
-
const finalPath = path ? `${path}.elements[${insertComponentPath}]` : `elements[${insertComponentPath}]`;
|
|
222
|
-
|
|
223
|
-
const copiedData = JSON.parse(sessionStorage.getItem("copiedConfig"));
|
|
224
|
-
if(copiedData.Handler){
|
|
216
|
+
if (!sessionStorage.getItem("copiedConfig") ) {
|
|
225
217
|
store.setNotify({
|
|
226
|
-
FailMessage: "
|
|
218
|
+
FailMessage: "No item has been copied.",
|
|
227
219
|
Fail: true,
|
|
228
220
|
});
|
|
229
221
|
}
|
|
230
222
|
else{
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
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
|
+
}
|
|
234
244
|
}
|
|
245
|
+
// const schema = cloneDeep(store.schema);
|
|
246
|
+
|
|
247
|
+
|
|
235
248
|
},
|
|
236
249
|
|
|
237
250
|
RemoveItemButton: function(paramStore = store){
|
|
@@ -240,7 +253,6 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
|
|
|
240
253
|
schema.properties.RemoveItemButton.disabled = true;
|
|
241
254
|
// schema.properties.Paste_Icon.disabled = true;
|
|
242
255
|
sessionStorage.removeItem('copiedConfig');
|
|
243
|
-
|
|
244
256
|
store.setSchema(schema);
|
|
245
257
|
store.setUiSchema(uiSchema);
|
|
246
258
|
},
|
|
@@ -42,7 +42,11 @@ export default (funcParams: funcParamsProps) => {
|
|
|
42
42
|
return UiSchema;
|
|
43
43
|
},
|
|
44
44
|
getSchema: () => {
|
|
45
|
-
|
|
45
|
+
const schema = _.cloneDeep(PageMasterSchema);
|
|
46
|
+
if (sessionStorage.getItem("copiedConfig") ) {
|
|
47
|
+
schema.properties.RemoveItemButton.disabled = false;
|
|
48
|
+
}
|
|
49
|
+
return schema;
|
|
46
50
|
},
|
|
47
51
|
backHandler: () => {
|
|
48
52
|
sessionStorage.removeItem("pageFormdata")
|