impaktapps-ui-builder 1.0.107 → 1.0.108
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 +15 -11
- 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/dist/src/impaktapps-ui-builder/runtime/services/service.d.ts +1 -1
- package/package.json +1 -1
- package/src/impaktapps-ui-builder/builder/build/buildCard.ts +3 -3
- package/src/impaktapps-ui-builder/builder/services/pageMaster.ts +14 -14
- package/src/impaktapps-ui-builder/runtime/services/events.ts +7 -3
- package/src/impaktapps-ui-builder/runtime/services/service.ts +11 -10
|
@@ -27,7 +27,7 @@ declare const _default: (funcParams: funcParamsProps) => {
|
|
|
27
27
|
onBack: (functionParameters: any) => Promise<void>;
|
|
28
28
|
onNext: (functionParameters: any) => Promise<void>;
|
|
29
29
|
onReset: (functionParameters: any) => Promise<void>;
|
|
30
|
-
callHandler: (eventType: string, functionParameters?: any) =>
|
|
30
|
+
callHandler: (eventType: string, functionParameters?: any) => void;
|
|
31
31
|
downloadFile: typeof downloadFile;
|
|
32
32
|
downloadFileFromUrl: (response: any, service: any) => void;
|
|
33
33
|
};
|
package/package.json
CHANGED
|
@@ -7,9 +7,9 @@ export const buildCard = (config,componentScope,store) =>{
|
|
|
7
7
|
if (config.style) {
|
|
8
8
|
card.config.wrapperStyle = JSON.parse(config.style)
|
|
9
9
|
}
|
|
10
|
-
card.elements[0].elements[0].elements[0].elements[1].scope = `#/properties/${config.name}/properties/value
|
|
11
|
-
card.elements[1].scope = `#/properties/${config.name}/properties/url
|
|
12
|
-
card.elements[0].elements[0].elements[1].scope = `#/properties/${config.name}/properties/description
|
|
10
|
+
card.elements[0].elements[0].elements[0].elements[1].scope = `#/properties/${config.name}/properties/value`;
|
|
11
|
+
card.elements[1].scope = `#/properties/${config.name}/properties/url`;
|
|
12
|
+
card.elements[0].elements[0].elements[1].scope = `#/properties/${config.name}/properties/description`;
|
|
13
13
|
if(config.layout){
|
|
14
14
|
card.config.layout = createLayoutFormat(config.layout)
|
|
15
15
|
}
|
|
@@ -31,18 +31,18 @@ export default (funcParams: funcParamsProps) => {
|
|
|
31
31
|
return formData;
|
|
32
32
|
}
|
|
33
33
|
saveFormdataInSessionStorage(config)
|
|
34
|
-
return config
|
|
34
|
+
return { ...config, type: "page" }
|
|
35
35
|
},
|
|
36
36
|
getUiSchema: function () {
|
|
37
37
|
const UiSchema = _.cloneDeep(PageMasterUiSchema(store.theme.myTheme));
|
|
38
|
-
if (sessionStorage.getItem("copiedConfig")
|
|
38
|
+
if (sessionStorage.getItem("copiedConfig")) {
|
|
39
39
|
Component(store, dynamicData, submitHandler, service).ElementPathSetter(UiSchema)
|
|
40
40
|
}
|
|
41
41
|
return UiSchema;
|
|
42
42
|
},
|
|
43
43
|
getSchema: () => {
|
|
44
44
|
const schema = _.cloneDeep(PageMasterSchema);
|
|
45
|
-
if (sessionStorage.getItem("copiedConfig")
|
|
45
|
+
if (sessionStorage.getItem("copiedConfig")) {
|
|
46
46
|
schema.properties.RemoveItemButton.disabled = false;
|
|
47
47
|
}
|
|
48
48
|
return schema;
|
|
@@ -70,8 +70,8 @@ export default (funcParams: funcParamsProps) => {
|
|
|
70
70
|
},
|
|
71
71
|
saveHandler: async () => await saveHandler(store, service, submitHandler),
|
|
72
72
|
Edit_Components: Component(store, dynamicData, submitHandler, service).editComponents,
|
|
73
|
-
|
|
74
|
-
Delete_Components: async function() {
|
|
73
|
+
|
|
74
|
+
Delete_Components: async function () {
|
|
75
75
|
await Component(store, dynamicData, submitHandler, service).deleteComponents(false);
|
|
76
76
|
store.updateDialog("popUpPageMasterComponent");
|
|
77
77
|
},
|
|
@@ -99,25 +99,25 @@ export default (funcParams: funcParamsProps) => {
|
|
|
99
99
|
store.updateDialog("popUpPageMasterEvent");
|
|
100
100
|
sessionStorage.removeItem('rowId');
|
|
101
101
|
},
|
|
102
|
-
deletePopUpComponent: function(){
|
|
102
|
+
deletePopUpComponent: function () {
|
|
103
103
|
const rowId = dynamicData.path.split(".")[1];
|
|
104
|
-
sessionStorage.setItem('rowId',rowId);
|
|
104
|
+
sessionStorage.setItem('rowId', rowId);
|
|
105
105
|
store.updateDialog("popUpPageMasterComponent");
|
|
106
106
|
},
|
|
107
|
-
deletePopUpEvent: function(){
|
|
107
|
+
deletePopUpEvent: function () {
|
|
108
108
|
const rowId = dynamicData.path.split(".")[1];
|
|
109
|
-
sessionStorage.setItem('rowId',rowId);
|
|
109
|
+
sessionStorage.setItem('rowId', rowId);
|
|
110
110
|
store.updateDialog("popUpPageMasterEvent");
|
|
111
111
|
},
|
|
112
112
|
|
|
113
113
|
|
|
114
|
-
copyPasteElement:
|
|
115
|
-
Component(store, dynamicData, submitHandler, service).copyPasteElement(store,this.setPage.bind(this));
|
|
114
|
+
copyPasteElement: function () {
|
|
115
|
+
Component(store, dynamicData, submitHandler, service).copyPasteElement(store, this.setPage.bind(this));
|
|
116
116
|
},
|
|
117
|
-
|
|
118
|
-
RemoveItemButton: function(){
|
|
117
|
+
|
|
118
|
+
RemoveItemButton: function () {
|
|
119
119
|
Component(store, dynamicData, submitHandler, service).RemoveItemButton(store)
|
|
120
120
|
},
|
|
121
|
-
|
|
121
|
+
|
|
122
122
|
}
|
|
123
123
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import _ from "lodash";
|
|
1
|
+
import _, { isObject, mapKeys } from "lodash";
|
|
2
2
|
import { handlersProps } from "./interface";
|
|
3
3
|
export const executeEvents = (params: handlersProps) => {
|
|
4
4
|
let nextEvent = [];
|
|
@@ -176,12 +176,16 @@ function mergeFormdata(handlerResponse: any, componentName: string, eventConfig:
|
|
|
176
176
|
}
|
|
177
177
|
}
|
|
178
178
|
else if (eventConfig.type === "page") {
|
|
179
|
-
if (!(_.isEmpty(handlerResponse?.data) && handlerResponse?.data)) {
|
|
179
|
+
if (!(_.isEmpty(handlerResponse?.data) && handlerResponse?.data && isObject(handlerResponse.data))) {
|
|
180
180
|
store.newData = {
|
|
181
181
|
...store.newData,
|
|
182
182
|
...handlerResponse?.data
|
|
183
183
|
}
|
|
184
|
-
|
|
184
|
+
const keys = Object.keys(handlerResponse.data)
|
|
185
|
+
keys.map((e) => {
|
|
186
|
+
formDataHolder[e] = { ...formDataHolder, [e]: handlerResponse.data[e] }
|
|
187
|
+
})
|
|
188
|
+
|
|
185
189
|
}
|
|
186
190
|
}
|
|
187
191
|
else if (eventConfig.type === "Table" && eventConfig.lazyLoading) {
|
|
@@ -62,7 +62,7 @@ export const extractEvents = (eventConfig: any) => {
|
|
|
62
62
|
return eventGroups;
|
|
63
63
|
};
|
|
64
64
|
export default (funcParams: funcParamsProps) => {
|
|
65
|
-
const formDataHolder = {}
|
|
65
|
+
const formDataHolder = {};
|
|
66
66
|
let executeEventsParameters: handlersProps = {
|
|
67
67
|
config: {}, componentName: "",
|
|
68
68
|
store: funcParams.store, dynamicData: funcParams.dynamicData, userValue: funcParams.userValue, service: funcParams.service,
|
|
@@ -92,7 +92,7 @@ export default (funcParams: funcParamsProps) => {
|
|
|
92
92
|
functionsProvider: funcParams.functionsProvider,
|
|
93
93
|
serviceHolder: this, eventGroups, formDataHolder,
|
|
94
94
|
}
|
|
95
|
-
|
|
95
|
+
|
|
96
96
|
funcParams.store.setSchema(
|
|
97
97
|
(pre: any) => {
|
|
98
98
|
return {
|
|
@@ -225,38 +225,39 @@ export default (funcParams: funcParamsProps) => {
|
|
|
225
225
|
},
|
|
226
226
|
onBack: async function (functionParameters) {
|
|
227
227
|
const path = funcParams.dynamicData?.tableButtonPath || funcParams.dynamicData.path.split(".")[0];
|
|
228
|
-
|
|
228
|
+
this.callHandler("onBack", functionParameters)
|
|
229
229
|
if (eventGroups?.["onBack"]?.[path] === undefined) {
|
|
230
230
|
functionParameters?.handleBack()
|
|
231
231
|
}
|
|
232
232
|
},
|
|
233
233
|
onNext: async function (functionParameters) {
|
|
234
234
|
const path = funcParams.dynamicData?.tableButtonPath || funcParams.dynamicData.path.split(".")[0];
|
|
235
|
-
|
|
235
|
+
this.callHandler("onNext", functionParameters)
|
|
236
236
|
if (eventGroups?.["onNext"]?.[path] === undefined) {
|
|
237
237
|
functionParameters?.handleNext()
|
|
238
238
|
}
|
|
239
239
|
},
|
|
240
240
|
onReset: async function (functionParameters) {
|
|
241
241
|
const path = funcParams.dynamicData?.tableButtonPath || funcParams.dynamicData.path.split(".")[0];
|
|
242
|
-
|
|
242
|
+
this.callHandler("onReset", functionParameters)
|
|
243
243
|
if (eventGroups?.["onReset"]?.[path] === undefined) {
|
|
244
244
|
functionParameters?.handleReset()
|
|
245
245
|
}
|
|
246
246
|
},
|
|
247
|
-
callHandler:
|
|
247
|
+
callHandler: function (eventType: string, functionParameters?: any) {
|
|
248
248
|
const path = funcParams.dynamicData?.tableButtonPath || funcParams.dynamicData.path.split(".")[funcParams.dynamicData.path.split(".").length - 1];
|
|
249
249
|
if (eventGroups?.[eventType]?.[path] !== undefined) {
|
|
250
|
-
|
|
250
|
+
(eventGroups?.[eventType]?.[path].map((eventConfig) => {
|
|
251
251
|
executeEventsParameters.store.functionParameters = functionParameters
|
|
252
252
|
if (eventConfig.Handler === "refresh") {
|
|
253
|
-
|
|
253
|
+
executeEvents({
|
|
254
254
|
...executeEventsParameters,
|
|
255
255
|
config: eventConfig,
|
|
256
256
|
componentName: path,
|
|
257
257
|
formDataHolder: formDataHolder
|
|
258
|
-
})
|
|
259
|
-
|
|
258
|
+
}).then((res) => {
|
|
259
|
+
funcParams.store.setFormdata((pre) => ({ ...pre, ...formDataHolder }));
|
|
260
|
+
});
|
|
260
261
|
} else {
|
|
261
262
|
executeEvents({
|
|
262
263
|
...executeEventsParameters,
|