impaktapps-ui-builder 0.0.382-alpha.334 → 0.0.382-alpha.335
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 +49 -76
- package/dist/impaktapps-ui-builder.es.js.map +1 -1
- package/dist/impaktapps-ui-builder.umd.js +11 -11
- package/dist/impaktapps-ui-builder.umd.js.map +1 -1
- package/dist/src/impaktapps-ui-builder/runtime/services/events.d.ts +2 -5
- package/package.json +1 -1
- package/src/impaktapps-ui-builder/runtime/services/events.ts +110 -90
|
@@ -1319,7 +1319,7 @@ var lodash = { exports: {} };
|
|
|
1319
1319
|
}
|
|
1320
1320
|
var runInContext = function runInContext2(context) {
|
|
1321
1321
|
context = context == null ? root : _2.defaults(root.Object(), context, _2.pick(root, contextProps));
|
|
1322
|
-
var Array2 = context.Array, Date = context.Date,
|
|
1322
|
+
var Array2 = context.Array, Date = context.Date, Error = context.Error, Function2 = context.Function, Math = context.Math, Object2 = context.Object, RegExp2 = context.RegExp, String = context.String, TypeError = context.TypeError;
|
|
1323
1323
|
var arrayProto = Array2.prototype, funcProto = Function2.prototype, objectProto = Object2.prototype;
|
|
1324
1324
|
var coreJsData = context["__core-js_shared__"];
|
|
1325
1325
|
var funcToString = funcProto.toString;
|
|
@@ -1804,7 +1804,7 @@ var lodash = { exports: {} };
|
|
|
1804
1804
|
if (typeof func != "function") {
|
|
1805
1805
|
throw new TypeError(FUNC_ERROR_TEXT);
|
|
1806
1806
|
}
|
|
1807
|
-
return
|
|
1807
|
+
return setTimeout(function() {
|
|
1808
1808
|
func.apply(undefined$1, args);
|
|
1809
1809
|
}, wait);
|
|
1810
1810
|
}
|
|
@@ -3635,7 +3635,7 @@ var lodash = { exports: {} };
|
|
|
3635
3635
|
return object[key];
|
|
3636
3636
|
}
|
|
3637
3637
|
var setData = shortOut(baseSetData);
|
|
3638
|
-
var
|
|
3638
|
+
var setTimeout = ctxSetTimeout || function(func, wait) {
|
|
3639
3639
|
return root.setTimeout(func, wait);
|
|
3640
3640
|
};
|
|
3641
3641
|
var setToString = shortOut(baseSetToString);
|
|
@@ -4427,7 +4427,7 @@ var lodash = { exports: {} };
|
|
|
4427
4427
|
}
|
|
4428
4428
|
function leadingEdge(time) {
|
|
4429
4429
|
lastInvokeTime = time;
|
|
4430
|
-
timerId =
|
|
4430
|
+
timerId = setTimeout(timerExpired, wait);
|
|
4431
4431
|
return leading ? invokeFunc(time) : result2;
|
|
4432
4432
|
}
|
|
4433
4433
|
function remainingWait(time) {
|
|
@@ -4443,7 +4443,7 @@ var lodash = { exports: {} };
|
|
|
4443
4443
|
if (shouldInvoke(time)) {
|
|
4444
4444
|
return trailingEdge(time);
|
|
4445
4445
|
}
|
|
4446
|
-
timerId =
|
|
4446
|
+
timerId = setTimeout(timerExpired, remainingWait(time));
|
|
4447
4447
|
}
|
|
4448
4448
|
function trailingEdge(time) {
|
|
4449
4449
|
timerId = undefined$1;
|
|
@@ -4474,12 +4474,12 @@ var lodash = { exports: {} };
|
|
|
4474
4474
|
}
|
|
4475
4475
|
if (maxing) {
|
|
4476
4476
|
clearTimeout(timerId);
|
|
4477
|
-
timerId =
|
|
4477
|
+
timerId = setTimeout(timerExpired, wait);
|
|
4478
4478
|
return invokeFunc(lastCallTime);
|
|
4479
4479
|
}
|
|
4480
4480
|
}
|
|
4481
4481
|
if (timerId === undefined$1) {
|
|
4482
|
-
timerId =
|
|
4482
|
+
timerId = setTimeout(timerExpired, wait);
|
|
4483
4483
|
}
|
|
4484
4484
|
return result2;
|
|
4485
4485
|
}
|
|
@@ -4722,7 +4722,7 @@ var lodash = { exports: {} };
|
|
|
4722
4722
|
}
|
|
4723
4723
|
function isNative(value) {
|
|
4724
4724
|
if (isMaskable(value)) {
|
|
4725
|
-
throw new
|
|
4725
|
+
throw new Error(CORE_ERROR_TEXT);
|
|
4726
4726
|
}
|
|
4727
4727
|
return baseIsNative(value);
|
|
4728
4728
|
}
|
|
@@ -5263,7 +5263,7 @@ var lodash = { exports: {} };
|
|
|
5263
5263
|
if (!variable) {
|
|
5264
5264
|
source = "with (obj) {\n" + source + "\n}\n";
|
|
5265
5265
|
} else if (reForbiddenIdentifierChars.test(variable)) {
|
|
5266
|
-
throw new
|
|
5266
|
+
throw new Error(INVALID_TEMPL_VAR_ERROR_TEXT);
|
|
5267
5267
|
}
|
|
5268
5268
|
source = (isEvaluating ? source.replace(reEmptyStringLeading, "") : source).replace(reEmptyStringMiddle, "$1").replace(reEmptyStringTrailing, "$1;");
|
|
5269
5269
|
source = "function(" + (variable || "obj") + ") {\n" + (variable ? "" : "obj || (obj = {});\n") + "var __t, __p = ''" + (isEscaping ? ", __e = _.escape" : "") + (isEvaluating ? ", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n" : ";\n") + source + "return __p\n}";
|
|
@@ -5382,7 +5382,7 @@ var lodash = { exports: {} };
|
|
|
5382
5382
|
try {
|
|
5383
5383
|
return apply(func, undefined$1, args);
|
|
5384
5384
|
} catch (e) {
|
|
5385
|
-
return isError(e) ? e : new
|
|
5385
|
+
return isError(e) ? e : new Error(e);
|
|
5386
5386
|
}
|
|
5387
5387
|
});
|
|
5388
5388
|
var bindAll = flatRest(function(object, methodNames) {
|
|
@@ -8878,6 +8878,7 @@ const executeEvents = async (params2) => {
|
|
|
8878
8878
|
var _a, _b, _c;
|
|
8879
8879
|
let nextEvent = [];
|
|
8880
8880
|
let finalResponse = null;
|
|
8881
|
+
let accumulatedData = {};
|
|
8881
8882
|
try {
|
|
8882
8883
|
const shouldExecute = await shouldEventExecute(params2);
|
|
8883
8884
|
if (!shouldExecute) {
|
|
@@ -8885,6 +8886,16 @@ const executeEvents = async (params2) => {
|
|
|
8885
8886
|
}
|
|
8886
8887
|
const response2 = await executeEventsHandler(params2);
|
|
8887
8888
|
finalResponse = response2;
|
|
8889
|
+
if (params2.config.Handler === "mergeFormdata") {
|
|
8890
|
+
const data2 = await mergeFormdata(
|
|
8891
|
+
params2.parentEventOutput,
|
|
8892
|
+
params2.componentName,
|
|
8893
|
+
params2.config,
|
|
8894
|
+
params2.store,
|
|
8895
|
+
params2.service
|
|
8896
|
+
);
|
|
8897
|
+
accumulatedData = { ...accumulatedData, ...data2 };
|
|
8898
|
+
}
|
|
8888
8899
|
const SuccessEvent = (_a = params2.config) == null ? void 0 : _a.events.filter((e) => e.eventType === "Success");
|
|
8889
8900
|
nextEvent = SuccessEvent;
|
|
8890
8901
|
} catch (err) {
|
|
@@ -8894,37 +8905,28 @@ const executeEvents = async (params2) => {
|
|
|
8894
8905
|
}
|
|
8895
8906
|
if ((nextEvent == null ? void 0 : nextEvent.length) > 0) {
|
|
8896
8907
|
for (const actionConfig of nextEvent) {
|
|
8897
|
-
await executeEvents({ ...params2, config: actionConfig, parentEventOutput: finalResponse });
|
|
8908
|
+
const result = await executeEvents({ ...params2, config: actionConfig, parentEventOutput: finalResponse });
|
|
8909
|
+
accumulatedData = { ...accumulatedData, ...result };
|
|
8898
8910
|
}
|
|
8899
8911
|
}
|
|
8912
|
+
params2.store.setFormdata((pre) => ({ ...pre, ...accumulatedData }));
|
|
8913
|
+
return finalResponse;
|
|
8900
8914
|
};
|
|
8901
8915
|
async function executeEventsHandler(params2) {
|
|
8902
8916
|
var _a, _b, _c;
|
|
8903
8917
|
if (params2.config.Handler === "api") {
|
|
8904
8918
|
const res = await executeApiEventHandler(params2);
|
|
8905
|
-
await asyncOperation();
|
|
8906
8919
|
return res;
|
|
8907
8920
|
} else if (params2.config.Handler === "inBuiltFunction") {
|
|
8908
8921
|
return await executeInBuiltFunctionHandler(params2);
|
|
8909
8922
|
} else if (params2.config.Handler === "custom") {
|
|
8910
8923
|
const res = await executeCustomHandler(params2);
|
|
8911
|
-
await asyncOperation();
|
|
8912
8924
|
return res;
|
|
8913
8925
|
} else if (params2.config.Handler === "refresh") {
|
|
8914
8926
|
const res = await executeRefreshHandler(params2);
|
|
8915
|
-
await asyncOperation();
|
|
8916
8927
|
return res;
|
|
8917
8928
|
} else if (params2.config.Handler === "mergeFormdata") {
|
|
8918
|
-
|
|
8919
|
-
params2.parentEventOutput,
|
|
8920
|
-
params2.componentName,
|
|
8921
|
-
params2.config,
|
|
8922
|
-
params2.store,
|
|
8923
|
-
params2.service
|
|
8924
|
-
);
|
|
8925
|
-
const res = result;
|
|
8926
|
-
await asyncOperation();
|
|
8927
|
-
return res;
|
|
8929
|
+
return params2.parentEventOutput;
|
|
8928
8930
|
} else if (params2.config.Handler === "onBackHandler") {
|
|
8929
8931
|
return (_a = params2.store.functionParameters) == null ? void 0 : _a.handleBack();
|
|
8930
8932
|
} else if (params2.config.Handler === "onNextHandler") {
|
|
@@ -8970,52 +8972,35 @@ async function executeCustomHandler(params) {
|
|
|
8970
8972
|
return response;
|
|
8971
8973
|
}
|
|
8972
8974
|
async function mergeFormdata(handlerResponse, componentName, eventConfig, store2, service2) {
|
|
8975
|
+
var _a, _b;
|
|
8976
|
+
let accumulatedData = {};
|
|
8973
8977
|
if (eventConfig.type === "Select" && !(_.isEmpty(handlerResponse == null ? void 0 : handlerResponse.data) && (handlerResponse == null ? void 0 : handlerResponse.data))) {
|
|
8974
|
-
|
|
8975
|
-
|
|
8976
|
-
|
|
8977
|
-
|
|
8978
|
-
|
|
8979
|
-
|
|
8980
|
-
[componentName]: {
|
|
8981
|
-
...(_a = pre.properties) == null ? void 0 : _a[componentName],
|
|
8982
|
-
oneOf: handlerResponse.data
|
|
8983
|
-
}
|
|
8984
|
-
}
|
|
8985
|
-
};
|
|
8986
|
-
});
|
|
8978
|
+
accumulatedData = {
|
|
8979
|
+
[componentName]: {
|
|
8980
|
+
...(_a = store2.schema.properties) == null ? void 0 : _a[componentName],
|
|
8981
|
+
oneOf: handlerResponse.data
|
|
8982
|
+
}
|
|
8983
|
+
};
|
|
8987
8984
|
} else if (eventConfig.type === "MultipleSelect" && !(_.isEmpty(handlerResponse == null ? void 0 : handlerResponse.data) && (handlerResponse == null ? void 0 : handlerResponse.data))) {
|
|
8988
|
-
|
|
8989
|
-
|
|
8990
|
-
|
|
8991
|
-
|
|
8992
|
-
|
|
8993
|
-
|
|
8994
|
-
[componentName]: {
|
|
8995
|
-
...(_a = pre.properties) == null ? void 0 : _a[componentName],
|
|
8996
|
-
type: "array",
|
|
8997
|
-
items: {
|
|
8998
|
-
oneOf: handlerResponse == null ? void 0 : handlerResponse.data
|
|
8999
|
-
}
|
|
9000
|
-
}
|
|
8985
|
+
accumulatedData = {
|
|
8986
|
+
[componentName]: {
|
|
8987
|
+
...(_b = store2.schema.properties) == null ? void 0 : _b[componentName],
|
|
8988
|
+
type: "array",
|
|
8989
|
+
items: {
|
|
8990
|
+
oneOf: handlerResponse == null ? void 0 : handlerResponse.data
|
|
9001
8991
|
}
|
|
9002
|
-
}
|
|
9003
|
-
}
|
|
8992
|
+
}
|
|
8993
|
+
};
|
|
9004
8994
|
} else if (eventConfig.type === "page") {
|
|
9005
8995
|
if (!(_.isEmpty(handlerResponse == null ? void 0 : handlerResponse.data) && (handlerResponse == null ? void 0 : handlerResponse.data))) {
|
|
9006
|
-
|
|
9007
|
-
return { ...pre, ...handlerResponse == null ? void 0 : handlerResponse.data };
|
|
9008
|
-
});
|
|
9009
|
-
await asyncOperation();
|
|
8996
|
+
accumulatedData = { ...handlerResponse == null ? void 0 : handlerResponse.data };
|
|
9010
8997
|
}
|
|
9011
8998
|
} else {
|
|
9012
8999
|
if (handlerResponse) {
|
|
9013
|
-
|
|
9014
|
-
return { ...pre, [componentName]: eventConfig.lazyLoading ? handlerResponse.data.data : handlerResponse.data };
|
|
9015
|
-
});
|
|
9016
|
-
await asyncOperation();
|
|
9000
|
+
accumulatedData = { [componentName]: eventConfig.lazyLoading ? handlerResponse.data.data : handlerResponse.data };
|
|
9017
9001
|
}
|
|
9018
9002
|
}
|
|
9003
|
+
return accumulatedData;
|
|
9019
9004
|
}
|
|
9020
9005
|
const buildBodyFormat = (body2, formData, userValue2) => {
|
|
9021
9006
|
const finalBody = { ...userValue2 == null ? void 0 : userValue2.payload };
|
|
@@ -9071,32 +9056,20 @@ async function buildApiPayload(compConfig, body, headers, store, dynamicData, us
|
|
|
9071
9056
|
}
|
|
9072
9057
|
return { body, headers };
|
|
9073
9058
|
}
|
|
9074
|
-
function getRefreshElements(eventConfig,
|
|
9059
|
+
function getRefreshElements(eventConfig, eventGroups2) {
|
|
9075
9060
|
var _a;
|
|
9076
9061
|
let result = [];
|
|
9077
9062
|
if (((_a = eventConfig == null ? void 0 : eventConfig.refreshElements) == null ? void 0 : _a.length) > 0) {
|
|
9078
|
-
result = eventConfig.refreshElements.map((e) =>
|
|
9079
|
-
return e.value;
|
|
9080
|
-
});
|
|
9063
|
+
result = eventConfig.refreshElements.map((e) => e.value);
|
|
9081
9064
|
} else {
|
|
9082
|
-
if (
|
|
9083
|
-
result = Object.keys(
|
|
9065
|
+
if (eventGroups2 == null ? void 0 : eventGroups2.onLoad) {
|
|
9066
|
+
result = Object.keys(eventGroups2 == null ? void 0 : eventGroups2.onLoad);
|
|
9084
9067
|
result.push(result[0]);
|
|
9085
9068
|
}
|
|
9086
9069
|
}
|
|
9087
9070
|
console.log(result);
|
|
9088
9071
|
return result;
|
|
9089
9072
|
}
|
|
9090
|
-
function asyncOperation() {
|
|
9091
|
-
return new Promise((resolve, reject) => {
|
|
9092
|
-
setTimeout(() => {
|
|
9093
|
-
{
|
|
9094
|
-
resolve("Operation completed successfully!");
|
|
9095
|
-
reject(new Error("Operation failed!"));
|
|
9096
|
-
}
|
|
9097
|
-
}, 50);
|
|
9098
|
-
});
|
|
9099
|
-
}
|
|
9100
9073
|
let compType;
|
|
9101
9074
|
let eventGroups = {};
|
|
9102
9075
|
const notifyUiSchema = {
|