impaktapps-ui-builder 0.0.286 → 0.0.287
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 +47 -35
- package/dist/impaktapps-ui-builder.es.js.map +1 -1
- package/dist/impaktapps-ui-builder.umd.js +6 -6
- package/dist/impaktapps-ui-builder.umd.js.map +1 -1
- package/dist/src/impaktapps-ui-builder/runtime/services/events.d.ts +1 -0
- package/dist/src/impaktapps-ui-builder/runtime/services/service.d.ts +2 -0
- package/package.json +1 -1
- package/src/impaktapps-ui-builder/runtime/services/events.ts +6 -5
- package/src/impaktapps-ui-builder/runtime/services/service.ts +42 -34
|
@@ -9785,7 +9785,7 @@ async function executeRefreshHandler(params2) {
|
|
|
9785
9785
|
const compToRefresh = getRefreshElements(params2.config, params2.eventGroups);
|
|
9786
9786
|
for (const componentName of compToRefresh) {
|
|
9787
9787
|
for (const compEventConfig of params2.eventGroups.onLoad[componentName]) {
|
|
9788
|
-
await executeEvents({ ...params2, config: compEventConfig });
|
|
9788
|
+
await executeEvents({ ...params2, config: compEventConfig, componentName });
|
|
9789
9789
|
}
|
|
9790
9790
|
}
|
|
9791
9791
|
}
|
|
@@ -9820,12 +9820,14 @@ async function executeCustomHandler(params) {
|
|
|
9820
9820
|
async function mergeFormdata(handlerResponse, componentName, eventConfig, store2) {
|
|
9821
9821
|
if (eventConfig.type === "Select" && !(_.isEmpty(handlerResponse) && handlerResponse)) {
|
|
9822
9822
|
store2.setSchema((pre) => {
|
|
9823
|
+
var _a;
|
|
9823
9824
|
return {
|
|
9824
9825
|
...pre,
|
|
9825
9826
|
properties: {
|
|
9826
9827
|
...pre.properties,
|
|
9827
9828
|
[componentName]: {
|
|
9828
|
-
|
|
9829
|
+
...(_a = pre.properties) == null ? void 0 : _a[componentName],
|
|
9830
|
+
oneOf: handlerResponse.data
|
|
9829
9831
|
}
|
|
9830
9832
|
}
|
|
9831
9833
|
};
|
|
@@ -9876,7 +9878,7 @@ async function shouldEventExecute(params2) {
|
|
|
9876
9878
|
var _a, _b;
|
|
9877
9879
|
const startEvent = (_b = (_a = params2.config) == null ? void 0 : _a.events) == null ? void 0 : _b.filter((e) => e.eventType === "onStart");
|
|
9878
9880
|
if ((startEvent == null ? void 0 : startEvent.length) > 0) {
|
|
9879
|
-
const
|
|
9881
|
+
const response2 = await executeEventsHandler({ ...params2, config: startEvent[0] });
|
|
9880
9882
|
return response2;
|
|
9881
9883
|
}
|
|
9882
9884
|
}
|
|
@@ -9977,11 +9979,7 @@ var service = (funcParams) => {
|
|
|
9977
9979
|
serviceHolder: this,
|
|
9978
9980
|
eventGroups
|
|
9979
9981
|
};
|
|
9980
|
-
await
|
|
9981
|
-
...executeEventsParameters,
|
|
9982
|
-
config: { Handler: "refresh", eventType: "onPageRefresh" },
|
|
9983
|
-
componentName: "all"
|
|
9984
|
-
});
|
|
9982
|
+
await executeRefreshHandler(executeEventsParameters);
|
|
9985
9983
|
funcParams.store.setSchema(
|
|
9986
9984
|
(pre) => {
|
|
9987
9985
|
return {
|
|
@@ -10004,34 +10002,24 @@ var service = (funcParams) => {
|
|
|
10004
10002
|
});
|
|
10005
10003
|
}
|
|
10006
10004
|
},
|
|
10007
|
-
onPaginationChange: async (paginationValues)
|
|
10008
|
-
var _a
|
|
10009
|
-
|
|
10010
|
-
|
|
10011
|
-
|
|
10012
|
-
|
|
10013
|
-
|
|
10014
|
-
|
|
10015
|
-
|
|
10005
|
+
onPaginationChange: async function(paginationValues) {
|
|
10006
|
+
var _a;
|
|
10007
|
+
const apiBody = [
|
|
10008
|
+
{ key: "size", value: paginationValues.pagination.pageSize },
|
|
10009
|
+
{ key: "start", value: paginationValues.pagination.pageIndex * paginationValues.pagination.pageSize },
|
|
10010
|
+
{ key: "sorting", value: paginationValues.sorting || [] },
|
|
10011
|
+
{ key: "filters", value: paginationValues.columnFilters || [] },
|
|
10012
|
+
{ key: "globalFilter", value: (_a = paginationValues.globalFilter) != null ? _a : "" }
|
|
10013
|
+
];
|
|
10014
|
+
return await this.updateConfigApiBody(paginationValues, apiBody);
|
|
10015
|
+
},
|
|
10016
|
+
getSelectOptions: async function(param) {
|
|
10017
|
+
if (param.serachValue !== "" && param.serachValue !== void 0) {
|
|
10018
|
+
const apiBody = [
|
|
10019
|
+
{ key: "serachValue", value: param.serachValue },
|
|
10020
|
+
{ key: "currentValue", value: param.currentValue }
|
|
10016
10021
|
];
|
|
10017
|
-
|
|
10018
|
-
eventConfig.body = [
|
|
10019
|
-
...eventConfig.body,
|
|
10020
|
-
...bodyValues
|
|
10021
|
-
];
|
|
10022
|
-
} else {
|
|
10023
|
-
eventConfig.body = bodyValues;
|
|
10024
|
-
}
|
|
10025
|
-
const responseEvent = (_b = eventConfig == null ? void 0 : eventConfig.events) == null ? void 0 : _b.filter((elem) => {
|
|
10026
|
-
return elem.Handler !== "mergeFormdata";
|
|
10027
|
-
});
|
|
10028
|
-
eventConfig.events = responseEvent != null ? responseEvent : [];
|
|
10029
|
-
const data2 = await executeEvents({
|
|
10030
|
-
...executeEventsParameters,
|
|
10031
|
-
config: eventConfig,
|
|
10032
|
-
componentName: paginationValues.path
|
|
10033
|
-
});
|
|
10034
|
-
return data2;
|
|
10022
|
+
return await this.updateConfigApiBody(param, apiBody);
|
|
10035
10023
|
}
|
|
10036
10024
|
},
|
|
10037
10025
|
onChange: async function() {
|
|
@@ -10051,6 +10039,30 @@ var service = (funcParams) => {
|
|
|
10051
10039
|
}));
|
|
10052
10040
|
}
|
|
10053
10041
|
},
|
|
10042
|
+
updateConfigApiBody: async function(paramValue, apiBody) {
|
|
10043
|
+
var _a;
|
|
10044
|
+
let LastCallResponse = void 0;
|
|
10045
|
+
for (const eventConfig of eventGroups == null ? void 0 : eventGroups.onLoad[paramValue.path]) {
|
|
10046
|
+
if (eventConfig.body) {
|
|
10047
|
+
eventConfig.body = [
|
|
10048
|
+
...eventConfig.body,
|
|
10049
|
+
...apiBody
|
|
10050
|
+
];
|
|
10051
|
+
} else {
|
|
10052
|
+
eventConfig.body = apiBody;
|
|
10053
|
+
}
|
|
10054
|
+
const responseEvent = (_a = eventConfig == null ? void 0 : eventConfig.events) == null ? void 0 : _a.filter((elem) => {
|
|
10055
|
+
return elem.Handler !== "mergeFormdata";
|
|
10056
|
+
});
|
|
10057
|
+
eventConfig.events = responseEvent != null ? responseEvent : [];
|
|
10058
|
+
LastCallResponse = await executeEvents({
|
|
10059
|
+
...executeEventsParameters,
|
|
10060
|
+
config: eventConfig,
|
|
10061
|
+
componentName: paramValue.path
|
|
10062
|
+
});
|
|
10063
|
+
}
|
|
10064
|
+
return LastCallResponse;
|
|
10065
|
+
},
|
|
10054
10066
|
downloadFile
|
|
10055
10067
|
};
|
|
10056
10068
|
};
|