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

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
  };
@@ -87,6 +87,27 @@ export declare const TableSection: (theme: any) => {
87
87
  };
88
88
  };
89
89
  accessorKey?: undefined;
90
+ } | {
91
+ header: string;
92
+ field: string;
93
+ flex: number;
94
+ widget: {
95
+ type: string;
96
+ scope: string;
97
+ options: {
98
+ widget: string;
99
+ };
100
+ config: {
101
+ main: {
102
+ icon: string;
103
+ onClick: string;
104
+ tooltipMessage: string;
105
+ color?: undefined;
106
+ };
107
+ style?: undefined;
108
+ };
109
+ };
110
+ accessorKey?: undefined;
90
111
  })[];
91
112
  }[];
92
113
  };
@@ -16,5 +16,7 @@ declare const _default: (store: any, dynamicData: any, submitHandler: any, servi
16
16
  backHandler: () => void;
17
17
  deletePopUpComponent: () => void;
18
18
  deletePopUpEvent: () => void;
19
+ CopyComponent: () => void;
20
+ PasteComponent: () => void;
19
21
  };
20
22
  export default _default;
@@ -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.2",
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
  };
@@ -95,7 +95,50 @@ export const TableSection = (theme) => {
95
95
  },
96
96
  },
97
97
  },
98
- }
98
+ },
99
+
100
+
101
+ {
102
+ header: "Copy",
103
+ field: "Copy_Component2",
104
+ flex: 1,
105
+ widget: {
106
+ type: "Control",
107
+ scope: "#/properties/CopyComponent2",
108
+ options: {
109
+ widget: "IconButton",
110
+ },
111
+ config: {
112
+ main: {
113
+ icon: "FileCopyIcon",
114
+ // color: "error",
115
+ onClick: "CopyComponent",
116
+ tooltipMessage: "Reject This Record",
117
+ },
118
+ },
119
+ },
120
+ },
121
+
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
+ },
99
142
  ]
100
143
  }]
101
144
  }
@@ -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
  {
@@ -172,5 +172,34 @@ 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 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}]`;
183
+
184
+ const formData = getFormdataFromSessionStorage(updatedPath);
185
+ sessionStorage.setItem('copiedComponent',formData);
186
+
187
+ },
188
+
189
+ PasteComponent: function(){
190
+ const path = store.searchParams?.get("path");
191
+ const rowId = dynamicData.path.split(".")[1];
192
+ const updatedPath = `${path}.elements[${rowId}]`;
193
+ const formData = getFormdataFromSessionStorage(updatedPath)
194
+ const insertComponentPath = formData.elements.length;
195
+
196
+ const finalPath = `${updatedPath}.elements[${insertComponentPath}]`;
197
+
198
+ const copiedData = sessionStorage.getItem('copiedComponent');
199
+ saveFormdataInSessionStorage(copiedData, finalPath);
200
+ sessionStorage.removeItem('copiedComponent')
201
+
202
+ }
203
+
175
204
  }
176
205
  };
@@ -101,5 +101,31 @@ 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
+ const updatedPath = path ? `${path}.elements[${rowId}]` : `elements[${rowId}]`;
110
+
111
+ const formData = getFormdataFromSessionStorage(updatedPath);
112
+ sessionStorage.setItem('copiedComponent',formData);
113
+
114
+ },
115
+
116
+ PasteComponent: function(){
117
+ const path = store.searchParams?.get("path");
118
+ const rowId = dynamicData.path.split(".")[1];
119
+ const updatedPath = `${path}.elements[${rowId}]`;
120
+ const formData = getFormdataFromSessionStorage(updatedPath)
121
+ const insertComponentPath = formData.elements.length;
122
+
123
+ const finalPath = `${updatedPath}.elements[${insertComponentPath}]`;
124
+
125
+ const copiedData = sessionStorage.getItem('copiedComponent');
126
+ saveFormdataInSessionStorage(copiedData, finalPath);
127
+ sessionStorage.removeItem('copiedComponent')
128
+
129
+ }
104
130
  }
105
131
  };