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/dist/impaktapps-ui-builder.es.js +19 -4
- package/dist/impaktapps-ui-builder.es.js.map +1 -1
- package/dist/impaktapps-ui-builder.umd.js +3 -3
- package/dist/impaktapps-ui-builder.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/impaktapps-ui-builder/builder/elements/UiSchema/Component/schema.ts +5 -1
- package/src/impaktapps-ui-builder/builder/elements/UiSchema/Component/uiSchema.ts +25 -3
- package/src/impaktapps-ui-builder/builder/services/component.ts +21 -1
package/package.json
CHANGED
|
@@ -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/
|
|
372
|
+
scope: "#/properties/copiedElementDetails",
|
|
373
|
+
|
|
370
374
|
options: {
|
|
371
|
-
widget: "
|
|
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
|
},
|