impaktapps-ui-builder 0.0.382-alpha.333 → 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 +53 -77
- 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 +1 -1
- package/package.json +1 -1
- package/src/impaktapps-ui-builder/runtime/services/events.ts +109 -89
- package/src/impaktapps-ui-builder/runtime/services/service.ts +6 -2
|
@@ -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,38 +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 }));
|
|
8900
8913
|
return finalResponse;
|
|
8901
8914
|
};
|
|
8902
8915
|
async function executeEventsHandler(params2) {
|
|
8903
8916
|
var _a, _b, _c;
|
|
8904
8917
|
if (params2.config.Handler === "api") {
|
|
8905
8918
|
const res = await executeApiEventHandler(params2);
|
|
8906
|
-
await asyncOperation();
|
|
8907
8919
|
return res;
|
|
8908
8920
|
} else if (params2.config.Handler === "inBuiltFunction") {
|
|
8909
8921
|
return await executeInBuiltFunctionHandler(params2);
|
|
8910
8922
|
} else if (params2.config.Handler === "custom") {
|
|
8911
8923
|
const res = await executeCustomHandler(params2);
|
|
8912
|
-
await asyncOperation();
|
|
8913
8924
|
return res;
|
|
8914
8925
|
} else if (params2.config.Handler === "refresh") {
|
|
8915
8926
|
const res = await executeRefreshHandler(params2);
|
|
8916
|
-
await asyncOperation();
|
|
8917
8927
|
return res;
|
|
8918
8928
|
} else if (params2.config.Handler === "mergeFormdata") {
|
|
8919
|
-
|
|
8920
|
-
params2.parentEventOutput,
|
|
8921
|
-
params2.componentName,
|
|
8922
|
-
params2.config,
|
|
8923
|
-
params2.store,
|
|
8924
|
-
params2.service
|
|
8925
|
-
);
|
|
8926
|
-
const res = result;
|
|
8927
|
-
await asyncOperation();
|
|
8928
|
-
return res;
|
|
8929
|
+
return params2.parentEventOutput;
|
|
8929
8930
|
} else if (params2.config.Handler === "onBackHandler") {
|
|
8930
8931
|
return (_a = params2.store.functionParameters) == null ? void 0 : _a.handleBack();
|
|
8931
8932
|
} else if (params2.config.Handler === "onNextHandler") {
|
|
@@ -8971,52 +8972,35 @@ async function executeCustomHandler(params) {
|
|
|
8971
8972
|
return response;
|
|
8972
8973
|
}
|
|
8973
8974
|
async function mergeFormdata(handlerResponse, componentName, eventConfig, store2, service2) {
|
|
8975
|
+
var _a, _b;
|
|
8976
|
+
let accumulatedData = {};
|
|
8974
8977
|
if (eventConfig.type === "Select" && !(_.isEmpty(handlerResponse == null ? void 0 : handlerResponse.data) && (handlerResponse == null ? void 0 : handlerResponse.data))) {
|
|
8975
|
-
|
|
8976
|
-
|
|
8977
|
-
|
|
8978
|
-
|
|
8979
|
-
|
|
8980
|
-
|
|
8981
|
-
[componentName]: {
|
|
8982
|
-
...(_a = pre.properties) == null ? void 0 : _a[componentName],
|
|
8983
|
-
oneOf: handlerResponse.data
|
|
8984
|
-
}
|
|
8985
|
-
}
|
|
8986
|
-
};
|
|
8987
|
-
});
|
|
8978
|
+
accumulatedData = {
|
|
8979
|
+
[componentName]: {
|
|
8980
|
+
...(_a = store2.schema.properties) == null ? void 0 : _a[componentName],
|
|
8981
|
+
oneOf: handlerResponse.data
|
|
8982
|
+
}
|
|
8983
|
+
};
|
|
8988
8984
|
} else if (eventConfig.type === "MultipleSelect" && !(_.isEmpty(handlerResponse == null ? void 0 : handlerResponse.data) && (handlerResponse == null ? void 0 : handlerResponse.data))) {
|
|
8989
|
-
|
|
8990
|
-
|
|
8991
|
-
|
|
8992
|
-
|
|
8993
|
-
|
|
8994
|
-
|
|
8995
|
-
[componentName]: {
|
|
8996
|
-
...(_a = pre.properties) == null ? void 0 : _a[componentName],
|
|
8997
|
-
type: "array",
|
|
8998
|
-
items: {
|
|
8999
|
-
oneOf: handlerResponse == null ? void 0 : handlerResponse.data
|
|
9000
|
-
}
|
|
9001
|
-
}
|
|
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
|
|
9002
8991
|
}
|
|
9003
|
-
}
|
|
9004
|
-
}
|
|
8992
|
+
}
|
|
8993
|
+
};
|
|
9005
8994
|
} else if (eventConfig.type === "page") {
|
|
9006
8995
|
if (!(_.isEmpty(handlerResponse == null ? void 0 : handlerResponse.data) && (handlerResponse == null ? void 0 : handlerResponse.data))) {
|
|
9007
|
-
|
|
9008
|
-
return { ...pre, ...handlerResponse == null ? void 0 : handlerResponse.data };
|
|
9009
|
-
});
|
|
9010
|
-
await asyncOperation();
|
|
8996
|
+
accumulatedData = { ...handlerResponse == null ? void 0 : handlerResponse.data };
|
|
9011
8997
|
}
|
|
9012
8998
|
} else {
|
|
9013
8999
|
if (handlerResponse) {
|
|
9014
|
-
|
|
9015
|
-
return { ...pre, [componentName]: eventConfig.lazyLoading ? handlerResponse.data.data : handlerResponse.data };
|
|
9016
|
-
});
|
|
9017
|
-
await asyncOperation();
|
|
9000
|
+
accumulatedData = { [componentName]: eventConfig.lazyLoading ? handlerResponse.data.data : handlerResponse.data };
|
|
9018
9001
|
}
|
|
9019
9002
|
}
|
|
9003
|
+
return accumulatedData;
|
|
9020
9004
|
}
|
|
9021
9005
|
const buildBodyFormat = (body2, formData, userValue2) => {
|
|
9022
9006
|
const finalBody = { ...userValue2 == null ? void 0 : userValue2.payload };
|
|
@@ -9072,32 +9056,20 @@ async function buildApiPayload(compConfig, body, headers, store, dynamicData, us
|
|
|
9072
9056
|
}
|
|
9073
9057
|
return { body, headers };
|
|
9074
9058
|
}
|
|
9075
|
-
function getRefreshElements(eventConfig,
|
|
9059
|
+
function getRefreshElements(eventConfig, eventGroups2) {
|
|
9076
9060
|
var _a;
|
|
9077
9061
|
let result = [];
|
|
9078
9062
|
if (((_a = eventConfig == null ? void 0 : eventConfig.refreshElements) == null ? void 0 : _a.length) > 0) {
|
|
9079
|
-
result = eventConfig.refreshElements.map((e) =>
|
|
9080
|
-
return e.value;
|
|
9081
|
-
});
|
|
9063
|
+
result = eventConfig.refreshElements.map((e) => e.value);
|
|
9082
9064
|
} else {
|
|
9083
|
-
if (
|
|
9084
|
-
result = Object.keys(
|
|
9065
|
+
if (eventGroups2 == null ? void 0 : eventGroups2.onLoad) {
|
|
9066
|
+
result = Object.keys(eventGroups2 == null ? void 0 : eventGroups2.onLoad);
|
|
9085
9067
|
result.push(result[0]);
|
|
9086
9068
|
}
|
|
9087
9069
|
}
|
|
9088
9070
|
console.log(result);
|
|
9089
9071
|
return result;
|
|
9090
9072
|
}
|
|
9091
|
-
function asyncOperation() {
|
|
9092
|
-
return new Promise((resolve, reject) => {
|
|
9093
|
-
setTimeout(() => {
|
|
9094
|
-
{
|
|
9095
|
-
resolve("Operation completed successfully!");
|
|
9096
|
-
reject(new Error("Operation failed!"));
|
|
9097
|
-
}
|
|
9098
|
-
}, 50);
|
|
9099
|
-
});
|
|
9100
|
-
}
|
|
9101
9073
|
let compType;
|
|
9102
9074
|
let eventGroups = {};
|
|
9103
9075
|
const notifyUiSchema = {
|
|
@@ -9302,7 +9274,11 @@ var service = (funcParams) => {
|
|
|
9302
9274
|
if (((_b = eventGroups == null ? void 0 : eventGroups[eventType]) == null ? void 0 : _b[path]) !== void 0) {
|
|
9303
9275
|
for (const eventConfig of (_c = eventGroups == null ? void 0 : eventGroups[eventType]) == null ? void 0 : _c[path]) {
|
|
9304
9276
|
executeEventsParameters.store.functionParameters = functionParameters;
|
|
9305
|
-
await
|
|
9277
|
+
await executeEvents({
|
|
9278
|
+
...executeEventsParameters,
|
|
9279
|
+
config: eventConfig,
|
|
9280
|
+
componentName: path
|
|
9281
|
+
});
|
|
9306
9282
|
}
|
|
9307
9283
|
}
|
|
9308
9284
|
},
|