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

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.
@@ -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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "impaktapps-ui-builder",
3
- "version": "0.0.963-CopyComponent.1",
3
+ "version": "0.0.963-CopyComponent.3",
4
4
  "scripts": {
5
5
  "dev": "vite",
6
6
  "build": "tsc && vite build",
@@ -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
  }
@@ -172,5 +172,36 @@ 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
+ sessionStorage.setItem('copiedComponent',JSON.stringify(formData));
187
+
188
+ },
189
+
190
+ PasteComponent: function(){
191
+ const path = store.searchParams?.get("path");
192
+ const rowId = dynamicData.path.split(".")[1];
193
+ const updatedPath = `${path}.elements[${rowId}]`;
194
+ const formData = getFormdataFromSessionStorage(updatedPath)
195
+ const insertComponentPath = formData.elements.length;
196
+
197
+ const finalPath = `${updatedPath}.elements[${insertComponentPath}]`;
198
+
199
+ // const copiedData = sessionStorage.getItem('copiedComponent');
200
+ const copiedData = JSON.parse(sessionStorage.getItem("copiedComponent"));
201
+ saveFormdataInSessionStorage(copiedData, finalPath);
202
+ sessionStorage.removeItem('copiedComponent')
203
+
204
+ }
205
+
175
206
  }
176
207
  };
@@ -106,9 +106,10 @@ export default (funcParams: funcParamsProps) => {
106
106
  const rowId = dynamicData.path.split(".")[1];
107
107
  const path = store.searchParams?.get("path");
108
108
  const id = store.searchParams?.get("id");
109
+ const updatedPath = path ? `${path}.elements[${rowId}]` : `elements[${rowId}]`;
109
110
 
110
- const formData = getFormdataFromSessionStorage(path);
111
- sessionStorage.setItem('copiedComponent',formData);
111
+ const formData = getFormdataFromSessionStorage(updatedPath);
112
+ sessionStorage.setItem('copiedComponent',JSON.stringify(formData));
112
113
 
113
114
  },
114
115
 
@@ -121,7 +122,8 @@ export default (funcParams: funcParamsProps) => {
121
122
 
122
123
  const finalPath = `${updatedPath}.elements[${insertComponentPath}]`;
123
124
 
124
- const copiedData = sessionStorage.getItem('copiedComponent');
125
+ // const copiedData = sessionStorage.getItem('copiedComponent');
126
+ const copiedData = JSON.parse(sessionStorage.getItem("copiedComponent"));
125
127
  saveFormdataInSessionStorage(copiedData, finalPath);
126
128
  sessionStorage.removeItem('copiedComponent')
127
129