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

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.
@@ -8,6 +8,7 @@ export declare const BarGraph: {
8
8
  main: {};
9
9
  style: {
10
10
  containerStyle: {};
11
+ labelStyle: {};
11
12
  };
12
13
  };
13
14
  };
@@ -69,6 +70,8 @@ export declare const HorizontalBarGraph: {
69
70
  main: {
70
71
  type: string;
71
72
  };
72
- style: {};
73
+ style: {
74
+ labelStyle: {};
75
+ };
73
76
  };
74
77
  };
@@ -63,5 +63,7 @@ declare const _default: (funcParams: funcParamsProps) => {
63
63
  deleteEvent: () => void;
64
64
  deletePopUpComponent: () => void;
65
65
  deletePopUpEvent: () => void;
66
+ CopyComponent: () => void;
67
+ PasteComponent: () => void;
66
68
  };
67
69
  export default _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "impaktapps-ui-builder",
3
- "version": "0.0.962",
3
+ "version": "0.0.963-CopyComponent.1",
4
4
  "scripts": {
5
5
  "dev": "vite",
6
6
  "build": "tsc && vite build",
@@ -2,43 +2,48 @@ import { createLayoutFormat } from "./buildConfig";
2
2
  import { HorizontalBarGraph } from "./uischema/graph";
3
3
  import _ from "lodash";
4
4
 
5
-
6
- const buildHorizontalBarGraph = (config:any,componentScope:string) => {
7
- const horizontalBarGraph: any = _.cloneDeep(HorizontalBarGraph);
8
- horizontalBarGraph.scope = componentScope;
9
- if (config.layout) {
10
- horizontalBarGraph.config.layout = createLayoutFormat(config.layout);
11
- }
12
- horizontalBarGraph.config.main.type = config.graphType;
13
- horizontalBarGraph.scope = componentScope;
14
- horizontalBarGraph.config.main.header = config.heading;
15
- if (config.barColor) {
16
- horizontalBarGraph.config.barStyle.color = config.barColor;
17
- }
18
- if (config.xAxisValue) {
19
- horizontalBarGraph.config.main.xAxisValue = config.xAxisValue;
20
- }
21
- if (config.containerBackground) {
22
- horizontalBarGraph.config.containerStyle.background =
23
- config.containerBackground;
24
- }
25
- if (config.height) {
26
- horizontalBarGraph.config.style =
27
- {
5
+ const buildHorizontalBarGraph = (config: any, componentScope: string) => {
6
+ const horizontalBarGraph: any = _.cloneDeep(HorizontalBarGraph);
7
+ horizontalBarGraph.scope = componentScope;
8
+ if (config.layout) {
9
+ horizontalBarGraph.config.layout = createLayoutFormat(config.layout);
10
+ }
11
+ horizontalBarGraph.config.main.type = config.graphType;
12
+ horizontalBarGraph.scope = componentScope;
13
+ horizontalBarGraph.config.main.header = config.heading;
14
+ if (config.barColor) {
15
+ horizontalBarGraph.config.barStyle.color = config.barColor;
16
+ }
17
+ if (config.xAxisValue) {
18
+ horizontalBarGraph.config.main.xAxisValue = config.xAxisValue;
19
+ }
20
+ if (config.containerBackground) {
21
+ horizontalBarGraph.config.containerStyle.background =
22
+ config.containerBackground;
23
+ }
24
+ if (config.height) {
25
+ horizontalBarGraph.config.style = {
28
26
  containerStyle: {
29
- height: config.height
30
- }
31
- }
32
-
33
- }
34
- if (config.bottomLabel) {
35
- horizontalBarGraph.config.main.bottomLabel =
36
- config.bottomLabel;
37
- }
38
- if (config.leftLabel) {
39
- horizontalBarGraph.config.main.leftLabel = config.leftLabel;
40
- }
41
- return horizontalBarGraph
42
- }
27
+ height: config.height,
28
+ },
29
+ };
30
+ }
31
+ if (config.bottomLabel) {
32
+ horizontalBarGraph.config.main.bottomLabel = config.bottomLabel;
33
+ }
34
+ if (config.leftLabel) {
35
+ horizontalBarGraph.config.main.leftLabel = config.leftLabel;
36
+ }
37
+ if (config.leftLabelMargin) {
38
+ horizontalBarGraph.config.style.labelStyle.margin = {
39
+ left: config.leftLabelMargin,
40
+ };
41
+ }
42
+ if (config.leftLabelOffset) {
43
+ horizontalBarGraph.config.style.labelStyle.leftLabelOffset =
44
+ config.leftLabelOffset;
45
+ }
46
+ return horizontalBarGraph;
47
+ };
43
48
 
44
- export default buildHorizontalBarGraph
49
+ export default buildHorizontalBarGraph;
@@ -33,6 +33,15 @@ export const buildLineGraph = (config, componentScope) => {
33
33
  if (config.pieArcColors) {
34
34
  lineGraph.config.style.lineStyle.colorRange = flatObjectValueInArray(config.pieArcColors);
35
35
  }
36
+ if (config.leftLabelMargin) {
37
+ lineGraph.config.style.labelStyle.margin = {
38
+ left: config.leftLabelMargin,
39
+ };
40
+ }
41
+ if (config.leftLabelOffset) {
42
+ lineGraph.config.style.labelStyle.leftLabelOffset =
43
+ config.leftLabelOffset;
44
+ }
36
45
  lineGraph.scope = componentScope;
37
46
  return lineGraph;
38
47
  }
@@ -27,6 +27,15 @@ export const buildStackbarGraph = (config:any,componentScope:string) => {
27
27
  if (config.leftLabel) {
28
28
  barGraph.config.main.leftLabel = config.leftLabel;
29
29
  }
30
+ if (config.leftLabelMargin) {
31
+ barGraph.config.style.labelStyle.margin = {
32
+ left: config.leftLabelMargin,
33
+ };
34
+ }
35
+ if (config.leftLabelOffset) {
36
+ barGraph.config.style.labelStyle.leftLabelOffset =
37
+ config.leftLabelOffset;
38
+ }
30
39
  barGraph.scope = componentScope;
31
40
  return barGraph;
32
41
  }
@@ -407,6 +407,8 @@ export const buildPropertiesSection = function (type: String) {
407
407
  ]),
408
408
  getInputField("leftLabel", "Left Label"),
409
409
  getInputField("bottomLabel", "Bottom Label"),
410
+ getInputField("leftLabelMargin", "Left Label Margin"),
411
+ getInputField("leftLabelOffset", "Left Label Offset"),
410
412
  emptyBox("GraphEmpty1", {xs: 6, sm: 0, md: 0, lg: 0 }),
411
413
  getRadioInputField("legendHide", "Legend Hide", ["YES", "No"]),
412
414
  getInputField("yAxisValue", "Y-AxisValue"),
@@ -8,7 +8,7 @@ export const BarGraph = {
8
8
  config: {
9
9
  main: {
10
10
  },
11
- style: { containerStyle: {} }
11
+ style: { containerStyle: {},labelStyle:{} }
12
12
  },
13
13
  };
14
14
 
@@ -72,7 +72,7 @@ export const HorizontalBarGraph = {
72
72
  type: "HorizontalBarGraph",
73
73
  },
74
74
  style:{
75
-
75
+ labelStyle:{}
76
76
  }
77
77
  },
78
78
  };
@@ -187,7 +187,50 @@ export const PageMasterUiSchema: any = (theme) => {
187
187
  },
188
188
  },
189
189
  },
190
- }
190
+ },
191
+
192
+ {
193
+ header: "Copy",
194
+ field: "Copy_Component",
195
+ flex: 1,
196
+ widget: {
197
+ type: "Control",
198
+ scope: "#/properties/CopyComponent",
199
+ options: {
200
+ widget: "IconButton",
201
+ },
202
+ config: {
203
+ main: {
204
+ icon: "FileCopyIcon",
205
+ // color: "error",
206
+ 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
+ },
230
+ },
231
+ },
232
+ },
233
+
191
234
  ]
192
235
  },
193
236
  {
@@ -101,5 +101,30 @@ export default (funcParams: funcParamsProps) => {
101
101
  sessionStorage.setItem('rowId',rowId);
102
102
  store.updateDialog("popUpPageMasterEvent");
103
103
  },
104
+
105
+ CopyComponent: function(){
106
+ const rowId = dynamicData.path.split(".")[1];
107
+ const path = store.searchParams?.get("path");
108
+ const id = store.searchParams?.get("id");
109
+
110
+ const formData = getFormdataFromSessionStorage(path);
111
+ sessionStorage.setItem('copiedComponent',formData);
112
+
113
+ },
114
+
115
+ PasteComponent: function(){
116
+ const path = store.searchParams?.get("path");
117
+ const rowId = dynamicData.path.split(".")[1];
118
+ const updatedPath = `${path}.elements[${rowId}]`;
119
+ const formData = getFormdataFromSessionStorage(updatedPath)
120
+ const insertComponentPath = formData.elements.length;
121
+
122
+ const finalPath = `${updatedPath}.elements[${insertComponentPath}]`;
123
+
124
+ const copiedData = sessionStorage.getItem('copiedComponent');
125
+ saveFormdataInSessionStorage(copiedData, finalPath);
126
+ sessionStorage.removeItem('copiedComponent')
127
+
128
+ }
104
129
  }
105
130
  };