impaktapps-ui-builder 0.0.962 → 0.0.963-CopyComponent.10

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.
Files changed (25) hide show
  1. package/dist/impaktapps-ui-builder.es.js +308 -8
  2. package/dist/impaktapps-ui-builder.es.js.map +1 -1
  3. package/dist/impaktapps-ui-builder.umd.js +13 -13
  4. package/dist/impaktapps-ui-builder.umd.js.map +1 -1
  5. package/dist/src/impaktapps-ui-builder/builder/build/uischema/eventSection.d.ts +55 -2
  6. package/dist/src/impaktapps-ui-builder/builder/build/uischema/graph.d.ts +4 -1
  7. package/dist/src/impaktapps-ui-builder/builder/build/uischema/tableSection.d.ts +47 -2
  8. package/dist/src/impaktapps-ui-builder/builder/services/component.d.ts +4 -0
  9. package/dist/src/impaktapps-ui-builder/builder/services/event.d.ts +2 -0
  10. package/dist/src/impaktapps-ui-builder/builder/services/pageMaster.d.ts +4 -0
  11. package/package.json +1 -1
  12. package/src/impaktapps-ui-builder/builder/build/buildHorizontalBarGraph.ts +43 -38
  13. package/src/impaktapps-ui-builder/builder/build/buildLineGraph.ts +9 -0
  14. package/src/impaktapps-ui-builder/builder/build/buildStackBarGraph.ts +9 -0
  15. package/src/impaktapps-ui-builder/builder/build/uischema/buildPropertiesSection.ts +2 -0
  16. package/src/impaktapps-ui-builder/builder/build/uischema/eventSection.ts +47 -0
  17. package/src/impaktapps-ui-builder/builder/build/uischema/graph.ts +2 -2
  18. package/src/impaktapps-ui-builder/builder/build/uischema/tableSection.ts +48 -1
  19. package/src/impaktapps-ui-builder/builder/elements/UiSchema/Component/schema.ts +5 -1
  20. package/src/impaktapps-ui-builder/builder/elements/UiSchema/Component/uiSchema.ts +25 -3
  21. package/src/impaktapps-ui-builder/builder/elements/UiSchema/PageMaster/uiSchema.ts +94 -1
  22. package/src/impaktapps-ui-builder/builder/elements/UiSchema/event/uiSchema.ts +45 -0
  23. package/src/impaktapps-ui-builder/builder/services/component.ts +150 -1
  24. package/src/impaktapps-ui-builder/builder/services/event.ts +26 -2
  25. package/src/impaktapps-ui-builder/builder/services/pageMaster.ts +38 -0
@@ -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,
@@ -187,7 +211,30 @@ export const PageMasterUiSchema: any = (theme) => {
187
211
  },
188
212
  },
189
213
  },
190
- }
214
+ },
215
+
216
+ {
217
+ header: "Copy",
218
+ field: "Copy_Component",
219
+ flex: 1,
220
+ widget: {
221
+ type: "Control",
222
+ scope: "#/properties/CopyComponent",
223
+ options: {
224
+ widget: "IconButton",
225
+ },
226
+ config: {
227
+ main: {
228
+ icon: "FileCopyIcon",
229
+ // color: "error",
230
+ onClick: "CopyComponent",
231
+ styleDefault: true,
232
+ },
233
+ },
234
+ },
235
+ },
236
+
237
+
191
238
  ]
192
239
  },
193
240
  {
@@ -223,6 +270,30 @@ export const PageMasterUiSchema: any = (theme) => {
223
270
  },
224
271
  }
225
272
  },
273
+
274
+ {
275
+ widget: {
276
+ type: "Control",
277
+ scope: "#/properties/Paste_Icon",
278
+
279
+ options: {
280
+ widget: "IconButton",
281
+ },
282
+ config: {
283
+ main: {
284
+ // color: "info",
285
+ onClick: "PasteEvent",
286
+ size: "small",
287
+ icon: "SendIcon",
288
+ iconLabel: "Paste",
289
+ styleDefault: true,
290
+ },
291
+ style: {
292
+ mt: "6px",
293
+ },
294
+ },
295
+ }
296
+ },
226
297
  ]
227
298
  },
228
299
 
@@ -284,6 +355,28 @@ export const PageMasterUiSchema: any = (theme) => {
284
355
  },
285
356
  },
286
357
  },
358
+
359
+
360
+ {
361
+ header: "Copy",
362
+ field: "Copy_Event",
363
+ flex: 1,
364
+ widget: {
365
+ type: "Control",
366
+ scope: "#/properties/CopyEvent",
367
+ options: {
368
+ widget: "IconButton",
369
+ },
370
+ config: {
371
+ main: {
372
+ icon: "FileCopyIcon",
373
+ // color: "error",
374
+ onClick: "CopyEvent",
375
+ styleDefault: true,
376
+ },
377
+ },
378
+ },
379
+ },
287
380
  ]
288
381
  // }]
289
382
  },
@@ -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,
@@ -166,6 +190,27 @@ export const EventUiSchema: any = (theme) => {
166
190
  },
167
191
  },
168
192
  },
193
+
194
+ {
195
+ header: "Copy",
196
+ field: "Copy_Event",
197
+ flex: 1,
198
+ widget: {
199
+ type: "Control",
200
+ scope: "#/properties/CopyEvent",
201
+ options: {
202
+ widget: "IconButton",
203
+ },
204
+ config: {
205
+ main: {
206
+ icon: "FileCopyIcon",
207
+ // color: "error",
208
+ onClick: "CopyEvent",
209
+ styleDefault: true,
210
+ },
211
+ },
212
+ },
213
+ },
169
214
  ]
170
215
  // }]
171
216
  }
@@ -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";
@@ -172,5 +172,154 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
172
172
  sessionStorage.setItem('rowId',rowId);
173
173
  store.updateDialog("popUpEventSection");
174
174
  },
175
+
176
+
177
+ CopyComponent: function(){
178
+ const schema = cloneDeep(store.schema);
179
+ const uiSchema = cloneDeep(store.uiSchema);
180
+ // schema.properties.CopyComponent.disabled = true;
181
+
182
+
183
+
184
+ const rowId = dynamicData.path.split(".")[1];
185
+ const parentPathOfCopiedComponent = store.searchParams?.get("path");
186
+ const copiedComponentPath = parentPathOfCopiedComponent ? `${parentPathOfCopiedComponent}.elements[${rowId}]` : `elements[${rowId}]`;
187
+
188
+
189
+ const formData = getFormdataFromSessionStorage(copiedComponentPath);
190
+
191
+ uiSchema.elements[5].config.main.heading = formData.name;
192
+
193
+
194
+ sessionStorage.setItem('copiedConfig',JSON.stringify(formData));
195
+
196
+ // store.setSchema(schema);
197
+ store.setUiSchema(uiSchema);
198
+ },
199
+
200
+ PasteComponent: function(){
201
+ // const schema = cloneDeep(store.schema);
202
+
203
+ const path = store.searchParams?.get("path");
204
+ const formData = getFormdataFromSessionStorage(path)
205
+ const insertComponentPath = formData.elements.length;
206
+ const finalPath = `${path}.elements[${insertComponentPath}]`;
207
+ const copiedData = JSON.parse(sessionStorage.getItem("copiedConfig"));
208
+ if(!copiedData.elements){
209
+ store.setNotify({
210
+ FailMessage: "Pasting not Valid",
211
+ Fail: true,
212
+ });
213
+ }
214
+ else{
215
+ saveFormdataInSessionStorage(copiedData, finalPath);
216
+ sessionStorage.removeItem('copiedConfig');
217
+
218
+ // schema.properties.CopyComponent.disabled = false;
219
+
220
+ this.setPage();
221
+ }
222
+ },
223
+
224
+
225
+ CopyEvent: function(){
226
+ const rowId = dynamicData.path.split(".")[1];
227
+ const path = store.searchParams?.get("path");
228
+ const updatedPath = path ? `${path}.events[${rowId}]` : `events[${rowId}]`;
229
+
230
+ const formData = getFormdataFromSessionStorage(updatedPath);
231
+ sessionStorage.setItem('copiedConfig',JSON.stringify(formData));
232
+ },
233
+
234
+ PasteEvent: function(){
235
+ const path = store.searchParams?.get("path");
236
+ const formData = getFormdataFromSessionStorage(path)
237
+ const insertComponentPath = formData.events.length;
238
+
239
+ const finalPath = `${path}.events[${insertComponentPath}]`;
240
+
241
+ const copiedData = JSON.parse(sessionStorage.getItem("copiedConfig"));
242
+ if(!copiedData.events){
243
+ store.setNotify({
244
+ FailMessage: "Pasting not Valid",
245
+ Fail: true,
246
+ });
247
+ }
248
+ else{
249
+ saveFormdataInSessionStorage(copiedData, finalPath);
250
+ sessionStorage.removeItem('copiedConfig');
251
+ this.setPage();
252
+ }
253
+ }
254
+
255
+
256
+
257
+
258
+
259
+
260
+
261
+
262
+ // CopyComponent: function(){
263
+ // const rowId = dynamicData.path.split(".")[1];
264
+ // const path = store.searchParams?.get("path");
265
+
266
+ // // const updatedPath = `${path}.elements[${rowId}]`;
267
+ // const updatedPath = path ? `${path}.elements[${rowId}]` : `elements[${rowId}]`;
268
+
269
+ // const formData = getFormdataFromSessionStorage(updatedPath);
270
+ // // sessionStorage.setItem('copiedComponent',formData);
271
+ // sessionStorage.setItem('copiedComponent',JSON.stringify(formData));
272
+
273
+ // },
274
+
275
+ // PasteComponent: function(){
276
+ // const path = store.searchParams?.get("path");
277
+ // const rowId = dynamicData.path.split(".")[1];
278
+ // // const updatedPath = `${path}.elements[${rowId}]`;
279
+ // const updatedPath = path ? `${path}.elements[${rowId}]` : `elements[${rowId}]`;
280
+ // const formData = getFormdataFromSessionStorage(updatedPath)
281
+ // const insertComponentPath = formData.elements.length;
282
+
283
+ // const finalPath = `${updatedPath}.elements[${insertComponentPath}]`;
284
+
285
+ // // const copiedData = sessionStorage.getItem('copiedComponent');
286
+ // const copiedData = JSON.parse(sessionStorage.getItem("copiedComponent"));
287
+ // saveFormdataInSessionStorage(copiedData, finalPath);
288
+ // sessionStorage.removeItem('copiedComponent');
289
+ // this.setPage();
290
+
291
+ // },
292
+
293
+
294
+
295
+ // CopyEvent: function(){
296
+ // const rowId = dynamicData.path.split(".")[1];
297
+ // const path = store.searchParams?.get("path");
298
+
299
+ // // const updatedPath = `${path}.elements[${rowId}]`;
300
+ // const updatedPath = path ? `${path}.events[${rowId}]` : `events[${rowId}]`;
301
+
302
+ // const formData = getFormdataFromSessionStorage(updatedPath);
303
+ // // sessionStorage.setItem('copiedComponent',formData);
304
+ // sessionStorage.setItem('copiedComponent',JSON.stringify(formData));
305
+ // },
306
+
307
+ // PasteEvent: function(){
308
+ // const path = store.searchParams?.get("path");
309
+ // const rowId = dynamicData.path.split(".")[1];
310
+ // // const updatedPath = `${path}.elements[${rowId}]`;
311
+ // const updatedPath = path ? `${path}.elements[${rowId}]` : `elements[${rowId}]`;
312
+ // const formData = getFormdataFromSessionStorage(updatedPath)
313
+ // const insertComponentPath = formData.elements.length;
314
+
315
+ // const finalPath = `${updatedPath}.events[${insertComponentPath}]`;
316
+
317
+ // // const copiedData = sessionStorage.getItem('copiedComponent');
318
+ // const copiedData = JSON.parse(sessionStorage.getItem("copiedComponent"));
319
+ // saveFormdataInSessionStorage(copiedData, finalPath);
320
+ // sessionStorage.removeItem('copiedComponent');
321
+ // this.setPage();
322
+ // }
323
+
175
324
  }
176
325
  };
@@ -1,7 +1,7 @@
1
1
  import { EventSchema } from "../elements/UiSchema/event/schema";
2
2
  import { EventUiSchema } from "../elements/UiSchema/event/uiSchema";
3
3
  import Component from "./component";
4
- import { okHandler, saveFormdataInSessionStorage, saveHandler } from "./utils";
4
+ import { okHandler, saveFormdataInSessionStorage, saveHandler, getFormdataFromSessionStorage } from "./utils";
5
5
  import { APISection } from "../build/uischema/apiSection";
6
6
  import { getRadioInputField, getSelectField, getTextArea } from "../build/uischema/buildPropertiesSection";
7
7
  import { refreshSectionUiSchema } from "../build/uischema/refresh";
@@ -138,6 +138,30 @@ export default (
138
138
  const rowId = dynamicData.path.split(".")[1];
139
139
  sessionStorage.setItem('rowId',rowId);
140
140
  store.updateDialog("popUpEvent");
141
- }
141
+ },
142
+
143
+ CopyEvent: Component(store, dynamicData, submitHandler, service).CopyEvent,
144
+ PasteEvent: Component(store, dynamicData, submitHandler, service).PasteEvent,
145
+
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}]`;
150
+
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;
159
+
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
+ // }
142
166
  }
143
167
  };
@@ -101,5 +101,43 @@ export default (funcParams: funcParamsProps) => {
101
101
  sessionStorage.setItem('rowId',rowId);
102
102
  store.updateDialog("popUpPageMasterEvent");
103
103
  },
104
+
105
+
106
+ CopyComponent: Component(store, dynamicData, submitHandler, service).CopyComponent,
107
+
108
+ PasteComponent: Component(store, dynamicData, submitHandler, service).PasteComponent,
109
+
110
+ CopyEvent: Component(store, dynamicData, submitHandler, service).CopyEvent,
111
+ PasteEvent: Component(store, dynamicData, submitHandler, service).PasteEvent,
112
+
113
+
114
+ // CopyComponent: function(){
115
+ // const rowId = dynamicData.path.split(".")[1];
116
+ // const path = store.searchParams?.get("path");
117
+ // const id = store.searchParams?.get("id");
118
+ // const updatedPath = path ? `${path}.elements[${rowId}]` : `elements[${rowId}]`;
119
+
120
+ // const formData = getFormdataFromSessionStorage(updatedPath);
121
+ // sessionStorage.setItem('copiedComponent',JSON.stringify(formData));
122
+
123
+ // },
124
+
125
+ // PasteComponent: function(){
126
+ // const path = store.searchParams?.get("path");
127
+ // const rowId = dynamicData.path.split(".")[1];
128
+ // // const updatedPath = `${path}.elements[${rowId}]`;
129
+ // const updatedPath = path ? `${path}.elements[${rowId}]` : `elements[${rowId}]`;
130
+ // const formData = getFormdataFromSessionStorage(updatedPath)
131
+ // const insertComponentPath = formData.elements.length;
132
+
133
+ // const finalPath = `${updatedPath}.elements[${insertComponentPath}]`;
134
+
135
+ // // const copiedData = sessionStorage.getItem('copiedComponent');
136
+ // const copiedData = JSON.parse(sessionStorage.getItem("copiedComponent"));
137
+ // saveFormdataInSessionStorage(copiedData, finalPath);
138
+ // sessionStorage.removeItem('copiedComponent');
139
+
140
+ // this.setPage();
141
+ // }
104
142
  }
105
143
  };