impaktapps-ui-builder 1.0.111 → 1.0.113
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 +169 -133
- package/dist/impaktapps-ui-builder.es.js.map +1 -1
- package/dist/impaktapps-ui-builder.umd.js +10 -10
- package/dist/impaktapps-ui-builder.umd.js.map +1 -1
- package/dist/src/impaktapps-ui-builder/builder/build/buildUiSchema.d.ts +1 -2
- package/dist/src/impaktapps-ui-builder/lib/index.d.ts +0 -1
- package/dist/src/impaktapps-ui-builder/runtime/services/downloadFile.d.ts +2 -5
- package/dist/src/impaktapps-ui-builder/runtime/services/service.d.ts +3 -4
- package/package.json +1 -1
- package/src/impaktapps-ui-builder/builder/build/buildCard.ts +3 -3
- package/src/impaktapps-ui-builder/builder/build/buildTable.ts +12 -12
- package/src/impaktapps-ui-builder/builder/build/buildUiSchema.ts +115 -63
- package/src/impaktapps-ui-builder/builder/build/uischema/buildPropertiesSection.ts +11 -6
- package/src/impaktapps-ui-builder/builder/elements/UiSchema/Component/schema.ts +14 -7
- package/src/impaktapps-ui-builder/builder/elements/UiSchema/event/schema.ts +1 -3
- package/src/impaktapps-ui-builder/builder/services/component.ts +1 -1
- package/src/impaktapps-ui-builder/builder/services/pageMaster.ts +14 -14
- package/src/impaktapps-ui-builder/lib/index.ts +9 -10
- package/src/impaktapps-ui-builder/runtime/services/downloadFile.ts +18 -33
- package/src/impaktapps-ui-builder/runtime/services/events.ts +10 -10
- package/src/impaktapps-ui-builder/runtime/services/service.ts +28 -41
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import _
|
|
1
|
+
import _ from "lodash";
|
|
2
2
|
import { handlersProps } from "./interface";
|
|
3
3
|
export const executeEvents = (params: handlersProps) => {
|
|
4
4
|
let nextEvent = [];
|
|
@@ -68,7 +68,8 @@ function executeEventsHandler(params: handlersProps) {
|
|
|
68
68
|
params.componentName,
|
|
69
69
|
params.config,
|
|
70
70
|
params.store,
|
|
71
|
-
params.
|
|
71
|
+
params.service,
|
|
72
|
+
params.formDataHolder
|
|
72
73
|
);
|
|
73
74
|
} else if (params.config.Handler === "onBackHandler") {
|
|
74
75
|
return params.store.functionParameters?.handleBack();
|
|
@@ -143,7 +144,8 @@ function executeCustomHandler(params: handlersProps) {
|
|
|
143
144
|
}
|
|
144
145
|
|
|
145
146
|
}
|
|
146
|
-
|
|
147
|
+
|
|
148
|
+
function mergeFormdata(handlerResponse: any, componentName: string, eventConfig: any, store: any, service: any, formDataHolder: any) {
|
|
147
149
|
if (eventConfig.type === "Select" && handlerResponse?.data) {
|
|
148
150
|
if (!_.isEmpty(handlerResponse?.data)) {
|
|
149
151
|
store.setSchema((pre) => {
|
|
@@ -176,30 +178,28 @@ function mergeFormdata(handlerResponse: any, componentName: string, eventConfig:
|
|
|
176
178
|
}
|
|
177
179
|
}
|
|
178
180
|
else if (eventConfig.type === "page") {
|
|
179
|
-
if (!(_.isEmpty(handlerResponse?.data) && handlerResponse?.data
|
|
181
|
+
if (!(_.isEmpty(handlerResponse?.data) && handlerResponse?.data)) {
|
|
180
182
|
store.newData = {
|
|
181
183
|
...store.newData,
|
|
182
184
|
...handlerResponse?.data
|
|
183
185
|
}
|
|
184
|
-
|
|
185
|
-
keys.map((e) => {
|
|
186
|
-
formDataHolder[e] = { ...formDataHolder, [e]: handlerResponse.data[e] }
|
|
187
|
-
})
|
|
188
|
-
|
|
186
|
+
store.setFormdata((pre: any) => { return { ...pre, ...handlerResponse?.data } })
|
|
189
187
|
}
|
|
190
188
|
}
|
|
191
189
|
else if (eventConfig.type === "Table" && eventConfig.lazyLoading) {
|
|
192
190
|
if (handlerResponse && handlerResponse?.data) {
|
|
193
191
|
formDataHolder[componentName] = handlerResponse.data?.data
|
|
194
192
|
formDataHolder[`${componentName}_RowCount`] = handlerResponse.data?.meta?.totalRowCount
|
|
193
|
+
store.setFormdata((pre) => { return { ...pre, ...formDataHolder } });
|
|
195
194
|
}
|
|
196
195
|
}
|
|
197
196
|
else {
|
|
198
197
|
if (handlerResponse) {
|
|
199
198
|
formDataHolder[componentName] = handlerResponse.data
|
|
199
|
+
store.setFormdata((pre) => { return { ...pre, ...formDataHolder } });
|
|
200
200
|
}
|
|
201
201
|
}
|
|
202
|
-
}
|
|
202
|
+
}
|
|
203
203
|
|
|
204
204
|
const buildBodyFormat = (body: any[], formData: any, userValue: any, store: any) => {
|
|
205
205
|
let finalBody = { ...userValue?.payload };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _, { isEmpty } from "lodash";
|
|
2
|
-
import {
|
|
2
|
+
import { doDownload, downloadFile } from "./downloadFile";
|
|
3
3
|
import { executeEvents, executeRefreshHandler } from "./events";
|
|
4
4
|
import { handlersProps } from "./interface";
|
|
5
5
|
let compType: string;
|
|
@@ -62,11 +62,11 @@ 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,
|
|
69
|
-
serviceHolder: { downloadFile, download:
|
|
69
|
+
serviceHolder: { downloadFile, download: doDownload, ...funcParams.functionsProvider }, eventGroups,
|
|
70
70
|
functionsProvider: funcParams.functionsProvider, formDataHolder
|
|
71
71
|
};
|
|
72
72
|
return {
|
|
@@ -90,7 +90,7 @@ export default (funcParams: funcParamsProps) => {
|
|
|
90
90
|
config: {}, componentName: "",
|
|
91
91
|
store: funcParams.store, dynamicData: funcParams.dynamicData, userValue: funcParams.userValue, service: funcParams.service,
|
|
92
92
|
functionsProvider: funcParams.functionsProvider,
|
|
93
|
-
serviceHolder: this, eventGroups, formDataHolder
|
|
93
|
+
serviceHolder: this, eventGroups, formDataHolder
|
|
94
94
|
}
|
|
95
95
|
|
|
96
96
|
funcParams.store.setSchema(
|
|
@@ -104,33 +104,31 @@ export default (funcParams: funcParamsProps) => {
|
|
|
104
104
|
await executeRefreshHandler({
|
|
105
105
|
config: {}, componentName: "",
|
|
106
106
|
store: funcParams.store, dynamicData: funcParams.dynamicData, userValue: funcParams.userValue, service: funcParams.service,
|
|
107
|
-
serviceHolder: this, eventGroups, formDataHolder:
|
|
107
|
+
serviceHolder: this, eventGroups, formDataHolder: {}
|
|
108
108
|
})
|
|
109
|
-
|
|
109
|
+
|
|
110
110
|
uiSchema.elements.push(notifyUiSchema);
|
|
111
111
|
funcParams.store.setUiSchema(uiSchema);
|
|
112
112
|
},
|
|
113
113
|
onCellRenderer: (cellParams) => {
|
|
114
|
-
|
|
115
|
-
if (cloneEventGroup.onCellRenderer) {
|
|
114
|
+
if (eventGroups.onCellRenderer) {
|
|
116
115
|
let finalResponse = {};
|
|
117
116
|
const path = funcParams.dynamicData?.tableButtonPath || funcParams?.dynamicData?.path?.split(".")[0];
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
}
|
|
127
|
-
return finalResponse
|
|
117
|
+
|
|
118
|
+
for (const eventConfig of eventGroups?.onCellRenderer?.[path]) {
|
|
119
|
+
executeEventsParameters.store.functionParameters = cellParams
|
|
120
|
+
finalResponse = executeEvents({
|
|
121
|
+
...executeEventsParameters,
|
|
122
|
+
config: eventConfig,
|
|
123
|
+
componentName: path
|
|
124
|
+
})
|
|
128
125
|
}
|
|
126
|
+
return finalResponse
|
|
129
127
|
}
|
|
130
128
|
return {}
|
|
131
129
|
},
|
|
132
|
-
onClick:
|
|
133
|
-
|
|
130
|
+
onClick: function () {
|
|
131
|
+
this.callHandler("onClick")
|
|
134
132
|
},
|
|
135
133
|
onKeyDown: function () {
|
|
136
134
|
this.callHandler("onKeyDown")
|
|
@@ -167,7 +165,7 @@ export default (funcParams: funcParamsProps) => {
|
|
|
167
165
|
{ key: "sorting", value: paginationValues.sorting || [] },
|
|
168
166
|
{ key: "filters", value: paginationValues.tableColumnConfig || [] },
|
|
169
167
|
{ key: "globalFilter", value: paginationValues.globalFilter ?? '' },
|
|
170
|
-
{ key: "expandedRowIds", value: paginationValues.expandedRowIds ?? []
|
|
168
|
+
{ key: "expandedRowIds", value: paginationValues.expandedRowIds ?? []}
|
|
171
169
|
]
|
|
172
170
|
const response = await this.callExecuteEvents(paginationValues, apiBody, "onLoad");
|
|
173
171
|
return response?.data;
|
|
@@ -232,14 +230,14 @@ export default (funcParams: funcParamsProps) => {
|
|
|
232
230
|
},
|
|
233
231
|
onNext: async function (functionParameters) {
|
|
234
232
|
const path = funcParams.dynamicData?.tableButtonPath || funcParams.dynamicData.path.split(".")[0];
|
|
235
|
-
|
|
233
|
+
await this.callHandler("onNext", functionParameters)
|
|
236
234
|
if (eventGroups?.["onNext"]?.[path] === undefined) {
|
|
237
235
|
functionParameters?.handleNext()
|
|
238
236
|
}
|
|
239
237
|
},
|
|
240
238
|
onReset: async function (functionParameters) {
|
|
241
239
|
const path = funcParams.dynamicData?.tableButtonPath || funcParams.dynamicData.path.split(".")[0];
|
|
242
|
-
this.callHandler("onReset", functionParameters)
|
|
240
|
+
await this.callHandler("onReset", functionParameters)
|
|
243
241
|
if (eventGroups?.["onReset"]?.[path] === undefined) {
|
|
244
242
|
functionParameters?.handleReset()
|
|
245
243
|
}
|
|
@@ -247,29 +245,18 @@ export default (funcParams: funcParamsProps) => {
|
|
|
247
245
|
callHandler: async function (eventType: string, functionParameters?: any) {
|
|
248
246
|
const path = funcParams.dynamicData?.tableButtonPath || funcParams.dynamicData.path.split(".")[funcParams.dynamicData.path.split(".").length - 1];
|
|
249
247
|
if (eventGroups?.[eventType]?.[path] !== undefined) {
|
|
250
|
-
(eventGroups?.[eventType]?.[path].map(
|
|
248
|
+
Promise.all(eventGroups?.[eventType]?.[path].map((eventConfig) => {
|
|
251
249
|
executeEventsParameters.store.functionParameters = functionParameters
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
formDataHolder: formDataHolder
|
|
258
|
-
})
|
|
259
|
-
funcParams.store.setFormdata((pre) => ({ ...pre, ...formDataHolder }));
|
|
260
|
-
|
|
261
|
-
} else {
|
|
262
|
-
executeEvents({
|
|
263
|
-
...executeEventsParameters,
|
|
264
|
-
config: eventConfig,
|
|
265
|
-
componentName: path
|
|
266
|
-
})
|
|
267
|
-
}
|
|
250
|
+
executeEvents({
|
|
251
|
+
...executeEventsParameters,
|
|
252
|
+
config: eventConfig,
|
|
253
|
+
componentName: path
|
|
254
|
+
})
|
|
268
255
|
}))
|
|
269
256
|
}
|
|
270
257
|
},
|
|
271
258
|
downloadFile: downloadFile,
|
|
272
|
-
|
|
259
|
+
download: doDownload,
|
|
273
260
|
...funcParams.functionsProvider
|
|
274
261
|
};
|
|
275
262
|
};
|