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

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.
@@ -80,6 +80,7 @@ export declare const EventSection: (theme: any) => {
80
80
  icon: string;
81
81
  tooltipMessage: string;
82
82
  onClick: string;
83
+ styleDefault?: undefined;
83
84
  };
84
85
  style: {
85
86
  color: any;
@@ -106,6 +107,7 @@ export declare const EventSection: (theme: any) => {
106
107
  tooltipMessage: string;
107
108
  onClick: string;
108
109
  size?: undefined;
110
+ styleDefault?: undefined;
109
111
  };
110
112
  style?: undefined;
111
113
  };
@@ -127,6 +129,7 @@ export declare const EventSection: (theme: any) => {
127
129
  icon: string;
128
130
  onClick: string;
129
131
  tooltipMessage: string;
132
+ styleDefault: boolean;
130
133
  color?: undefined;
131
134
  size?: undefined;
132
135
  };
@@ -80,6 +80,7 @@ export declare const TableSection: (theme: any) => {
80
80
  color: string;
81
81
  onClick: string;
82
82
  tooltipMessage: string;
83
+ styleDefault?: undefined;
83
84
  };
84
85
  style: {
85
86
  color: any;
@@ -103,6 +104,7 @@ export declare const TableSection: (theme: any) => {
103
104
  color: string;
104
105
  onClick: string;
105
106
  tooltipMessage: string;
107
+ styleDefault?: undefined;
106
108
  };
107
109
  style?: undefined;
108
110
  };
@@ -122,6 +124,7 @@ export declare const TableSection: (theme: any) => {
122
124
  main: {
123
125
  icon: string;
124
126
  onClick: string;
127
+ styleDefault: boolean;
125
128
  color?: undefined;
126
129
  tooltipMessage?: undefined;
127
130
  };
@@ -65,5 +65,7 @@ declare const _default: (funcParams: funcParamsProps) => {
65
65
  deletePopUpEvent: () => void;
66
66
  CopyComponent: () => void;
67
67
  PasteComponent: () => void;
68
+ CopyEvent: () => void;
69
+ PasteEvent: () => void;
68
70
  };
69
71
  export default _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "impaktapps-ui-builder",
3
- "version": "0.0.963-CopyComponent.7",
3
+ "version": "0.0.963-CopyComponent.9",
4
4
  "scripts": {
5
5
  "dev": "vite",
6
6
  "build": "tsc && vite build",
@@ -140,27 +140,7 @@ export const EventSection = (theme)=>{
140
140
  // color: "error",
141
141
  onClick: "CopyEvent",
142
142
  tooltipMessage: "Reject This Record",
143
- },
144
- },
145
- },
146
- },
147
-
148
- {
149
- header: "paste",
150
- field: "Paste_Event",
151
- flex: 1,
152
- widget: {
153
- type: "Control",
154
- scope: "#/properties/PasteEvent",
155
- options: {
156
- widget: "IconButton",
157
- },
158
- config: {
159
- main: {
160
- icon: "SendIcon",
161
- // color: "error",
162
- onClick: "PasteEvent",
163
- tooltipMessage: "Reject This Record",
143
+ styleDefault: true,
164
144
  },
165
145
  },
166
146
  },
@@ -138,12 +138,11 @@ export const TableSection = (theme) => {
138
138
  icon: "FileCopyIcon",
139
139
  // color: "error",
140
140
  onClick: "CopyComponent",
141
+ styleDefault: true,
141
142
  },
142
143
  },
143
144
  },
144
145
  },
145
-
146
-
147
146
  ]
148
147
  }]
149
148
  }
@@ -341,7 +341,11 @@ export const ComponentSchema: any = {
341
341
  name: {
342
342
  type: "string",
343
343
  },
344
- label: { type: 'string' }
344
+ label: { type: 'string' },
345
+
346
+ CopyComponent:{
347
+ disabled: false,
348
+ }
345
349
  },
346
350
 
347
351
  required: ["name",]
@@ -363,17 +363,39 @@ export const componentBasicUiSchema: any = (theme)=>{
363
363
  },
364
364
  },
365
365
  ]
366
- },
366
+ },
367
+
368
+
369
+
367
370
  {
368
371
  type: "Control",
369
- scope: "#/properties/EmptyBox",
372
+ scope: "#/properties/copiedElementDetails",
373
+
370
374
  options: {
371
- widget: "EmptyBox",
375
+ widget: "Box",
372
376
  },
373
377
  config: {
374
378
  layout: { xs: 4, sm: 8 },
379
+ main: {
380
+ heading: "",
381
+ },
382
+ style: {
383
+ float: "left"
384
+ }
375
385
  },
376
386
  },
387
+
388
+
389
+ // {
390
+ // type: "Control",
391
+ // scope: "#/properties/EmptyBox",
392
+ // options: {
393
+ // widget: "EmptyBox",
394
+ // },
395
+ // config: {
396
+ // layout: { xs: 4, sm: 8 },
397
+ // },
398
+ // },
377
399
  {
378
400
  type: "Control",
379
401
  scope: "#/properties/btn",
@@ -228,6 +228,7 @@ export const PageMasterUiSchema: any = (theme) => {
228
228
  icon: "FileCopyIcon",
229
229
  // color: "error",
230
230
  onClick: "CopyComponent",
231
+ styleDefault: true,
231
232
  },
232
233
  },
233
234
  },
@@ -371,6 +372,7 @@ export const PageMasterUiSchema: any = (theme) => {
371
372
  icon: "FileCopyIcon",
372
373
  // color: "error",
373
374
  onClick: "CopyEvent",
375
+ styleDefault: true,
374
376
  },
375
377
  },
376
378
  },
@@ -206,6 +206,7 @@ export const EventUiSchema: any = (theme) => {
206
206
  icon: "FileCopyIcon",
207
207
  // color: "error",
208
208
  onClick: "CopyEvent",
209
+ styleDefault: true,
209
210
  },
210
211
  },
211
212
  },
@@ -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";
@@ -175,20 +175,34 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
175
175
 
176
176
 
177
177
  CopyComponent: function(){
178
+ const schema = cloneDeep(store.schema);
179
+ const uiSchema = cloneDeep(store.uiSchema);
180
+ schema.properties.CopyComponent.disabled = true;
181
+
182
+
183
+
178
184
  const rowId = dynamicData.path.split(".")[1];
179
185
  const parentPathOfCopiedComponent = store.searchParams?.get("path");
180
186
  const copiedComponentPath = parentPathOfCopiedComponent ? `${parentPathOfCopiedComponent}.elements[${rowId}]` : `elements[${rowId}]`;
181
187
 
188
+
182
189
  const formData = getFormdataFromSessionStorage(copiedComponentPath);
190
+
191
+ uiSchema.elements[5].config.main.heading = formData.name;
192
+
193
+
183
194
  sessionStorage.setItem('copiedConfig',JSON.stringify(formData));
184
195
 
196
+ store.setSchema(schema);
197
+ store.setUiSchema(uiSchema);
185
198
  },
186
199
 
187
200
  PasteComponent: function(){
201
+ // const schema = cloneDeep(store.schema);
202
+
188
203
  const path = store.searchParams?.get("path");
189
204
  const formData = getFormdataFromSessionStorage(path)
190
205
  const insertComponentPath = formData.elements.length;
191
-
192
206
  const finalPath = `${path}.elements[${insertComponentPath}]`;
193
207
  const copiedData = JSON.parse(sessionStorage.getItem("copiedConfig"));
194
208
  if(!copiedData.elements){
@@ -197,9 +211,14 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
197
211
  Fail: true,
198
212
  });
199
213
  }
200
- saveFormdataInSessionStorage(copiedData, finalPath);
201
- sessionStorage.removeItem('copiedConfig');
202
- this.setPage();
214
+ else{
215
+ saveFormdataInSessionStorage(copiedData, finalPath);
216
+ sessionStorage.removeItem('copiedConfig');
217
+
218
+ // schema.properties.CopyComponent.disabled = false;
219
+
220
+ this.setPage();
221
+ }
203
222
  },
204
223
 
205
224
 
@@ -226,9 +245,11 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
226
245
  Fail: true,
227
246
  });
228
247
  }
229
- saveFormdataInSessionStorage(copiedData, finalPath);
230
- sessionStorage.removeItem('copiedConfig');
231
- this.setPage();
248
+ else{
249
+ saveFormdataInSessionStorage(copiedData, finalPath);
250
+ sessionStorage.removeItem('copiedConfig');
251
+ this.setPage();
252
+ }
232
253
  }
233
254
 
234
255
 
@@ -140,25 +140,28 @@ export default (
140
140
  store.updateDialog("popUpEvent");
141
141
  },
142
142
 
143
- CopyEvent: function(){
144
- const rowId = dynamicData.path.split(".")[1];
145
- const path = store.searchParams?.get("path");
146
- const updatedPath = path ? `${path}.events[${rowId}]` : `events[${rowId}]`;
143
+ CopyEvent: Component(store, dynamicData, submitHandler, service).CopyEvent,
144
+ PasteEvent: Component(store, dynamicData, submitHandler, service).PasteEvent,
147
145
 
148
- const formData = getFormdataFromSessionStorage(updatedPath);
149
- sessionStorage.setItem('copiedConfig',JSON.stringify(formData));
150
- },
146
+ // CopyEvent: function(){
147
+ // const rowId = dynamicData.path.split(".")[1];
148
+ // const path = store.searchParams?.get("path");
149
+ // const updatedPath = path ? `${path}.events[${rowId}]` : `events[${rowId}]`;
151
150
 
152
- PasteEvent: function(){
153
- const path = store.searchParams?.get("path");
154
- const formData = getFormdataFromSessionStorage(path)
155
- const insertComponentPath = formData.events.length;
151
+ // const formData = getFormdataFromSessionStorage(updatedPath);
152
+ // sessionStorage.setItem('copiedConfig',JSON.stringify(formData));
153
+ // },
154
+
155
+ // PasteEvent: function(){
156
+ // const path = store.searchParams?.get("path");
157
+ // const formData = getFormdataFromSessionStorage(path)
158
+ // const insertComponentPath = formData.events.length;
156
159
 
157
- const finalPath = `${path}.events[${insertComponentPath}]`;
158
- const copiedData = JSON.parse(sessionStorage.getItem("copiedConfig"));
159
- saveFormdataInSessionStorage(copiedData, finalPath);
160
- sessionStorage.removeItem('copiedConfig');
161
- this.setPage();
162
- }
160
+ // const finalPath = `${path}.events[${insertComponentPath}]`;
161
+ // const copiedData = JSON.parse(sessionStorage.getItem("copiedConfig"));
162
+ // saveFormdataInSessionStorage(copiedData, finalPath);
163
+ // sessionStorage.removeItem('copiedConfig');
164
+ // this.setPage();
165
+ // }
163
166
  }
164
167
  };
@@ -103,33 +103,13 @@ export default (funcParams: funcParamsProps) => {
103
103
  },
104
104
 
105
105
 
106
- CopyComponent: function(){
107
- const rowId = dynamicData.path.split(".")[1];
108
- const parentPathOfCopiedComponent = store.searchParams?.get("path");
109
- const copiedComponentPath = parentPathOfCopiedComponent ? `${parentPathOfCopiedComponent}.elements[${rowId}]` : `elements[${rowId}]`;
110
-
111
- const formData = getFormdataFromSessionStorage(copiedComponentPath);
112
- sessionStorage.setItem('copiedConfig',JSON.stringify(formData));
106
+ CopyComponent: Component(store, dynamicData, submitHandler, service).CopyComponent,
113
107
 
114
- },
108
+ PasteComponent: Component(store, dynamicData, submitHandler, service).PasteComponent,
115
109
 
116
- PasteComponent: function(){
117
- const path = store.searchParams?.get("path");
118
- const formData = getFormdataFromSessionStorage(path)
119
- const insertComponentPath = formData.elements.length;
110
+ CopyEvent: Component(store, dynamicData, submitHandler, service).CopyEvent,
111
+ PasteEvent: Component(store, dynamicData, submitHandler, service).PasteEvent,
120
112
 
121
- const finalPath = `${path}.elements[${insertComponentPath}]`;
122
- const copiedData = JSON.parse(sessionStorage.getItem("copiedConfig"));
123
- if(!copiedData.elements){
124
- store.setNotify({
125
- FailMessage: "Pasting not Valid",
126
- Fail: true,
127
- });
128
- }
129
- saveFormdataInSessionStorage(copiedData, finalPath);
130
- sessionStorage.removeItem('copiedConfig');
131
- this.setPage();
132
- }
133
113
 
134
114
  // CopyComponent: function(){
135
115
  // const rowId = dynamicData.path.split(".")[1];