impaktapps-ui-builder 0.0.963-CopyComponent.8 → 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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "impaktapps-ui-builder",
3
- "version": "0.0.963-CopyComponent.8",
3
+ "version": "0.0.963-CopyComponent.9",
4
4
  "scripts": {
5
5
  "dev": "vite",
6
6
  "build": "tsc && vite build",
@@ -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",
@@ -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,14 +175,31 @@ 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}]`;
187
+
188
+
181
189
  const formData = getFormdataFromSessionStorage(copiedComponentPath);
190
+
191
+ uiSchema.elements[5].config.main.heading = formData.name;
192
+
193
+
182
194
  sessionStorage.setItem('copiedConfig',JSON.stringify(formData));
195
+
196
+ store.setSchema(schema);
197
+ store.setUiSchema(uiSchema);
183
198
  },
184
199
 
185
200
  PasteComponent: function(){
201
+ // const schema = cloneDeep(store.schema);
202
+
186
203
  const path = store.searchParams?.get("path");
187
204
  const formData = getFormdataFromSessionStorage(path)
188
205
  const insertComponentPath = formData.elements.length;
@@ -197,6 +214,9 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
197
214
  else{
198
215
  saveFormdataInSessionStorage(copiedData, finalPath);
199
216
  sessionStorage.removeItem('copiedConfig');
217
+
218
+ // schema.properties.CopyComponent.disabled = false;
219
+
200
220
  this.setPage();
201
221
  }
202
222
  },