impaktapps-ui-builder 0.0.409-l → 0.0.409-m

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.
@@ -1128,7 +1128,7 @@ var lodash = { exports: {} };
1128
1128
  }
1129
1129
  var runInContext = function runInContext2(context) {
1130
1130
  context = context == null ? root : _2.defaults(root.Object(), context, _2.pick(root, contextProps));
1131
- 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;
1131
+ var Array2 = context.Array, Date = context.Date, Error2 = context.Error, Function2 = context.Function, Math = context.Math, Object2 = context.Object, RegExp2 = context.RegExp, String = context.String, TypeError = context.TypeError;
1132
1132
  var arrayProto = Array2.prototype, funcProto = Function2.prototype, objectProto = Object2.prototype;
1133
1133
  var coreJsData = context["__core-js_shared__"];
1134
1134
  var funcToString = funcProto.toString;
@@ -1613,7 +1613,7 @@ var lodash = { exports: {} };
1613
1613
  if (typeof func != "function") {
1614
1614
  throw new TypeError(FUNC_ERROR_TEXT);
1615
1615
  }
1616
- return setTimeout(function() {
1616
+ return setTimeout2(function() {
1617
1617
  func.apply(undefined$1, args);
1618
1618
  }, wait);
1619
1619
  }
@@ -3444,7 +3444,7 @@ var lodash = { exports: {} };
3444
3444
  return object[key];
3445
3445
  }
3446
3446
  var setData = shortOut(baseSetData);
3447
- var setTimeout = ctxSetTimeout || function(func, wait) {
3447
+ var setTimeout2 = ctxSetTimeout || function(func, wait) {
3448
3448
  return root.setTimeout(func, wait);
3449
3449
  };
3450
3450
  var setToString = shortOut(baseSetToString);
@@ -4236,7 +4236,7 @@ var lodash = { exports: {} };
4236
4236
  }
4237
4237
  function leadingEdge(time) {
4238
4238
  lastInvokeTime = time;
4239
- timerId = setTimeout(timerExpired, wait);
4239
+ timerId = setTimeout2(timerExpired, wait);
4240
4240
  return leading ? invokeFunc(time) : result2;
4241
4241
  }
4242
4242
  function remainingWait(time) {
@@ -4252,7 +4252,7 @@ var lodash = { exports: {} };
4252
4252
  if (shouldInvoke(time)) {
4253
4253
  return trailingEdge(time);
4254
4254
  }
4255
- timerId = setTimeout(timerExpired, remainingWait(time));
4255
+ timerId = setTimeout2(timerExpired, remainingWait(time));
4256
4256
  }
4257
4257
  function trailingEdge(time) {
4258
4258
  timerId = undefined$1;
@@ -4283,12 +4283,12 @@ var lodash = { exports: {} };
4283
4283
  }
4284
4284
  if (maxing) {
4285
4285
  clearTimeout(timerId);
4286
- timerId = setTimeout(timerExpired, wait);
4286
+ timerId = setTimeout2(timerExpired, wait);
4287
4287
  return invokeFunc(lastCallTime);
4288
4288
  }
4289
4289
  }
4290
4290
  if (timerId === undefined$1) {
4291
- timerId = setTimeout(timerExpired, wait);
4291
+ timerId = setTimeout2(timerExpired, wait);
4292
4292
  }
4293
4293
  return result2;
4294
4294
  }
@@ -4531,7 +4531,7 @@ var lodash = { exports: {} };
4531
4531
  }
4532
4532
  function isNative(value) {
4533
4533
  if (isMaskable(value)) {
4534
- throw new Error(CORE_ERROR_TEXT);
4534
+ throw new Error2(CORE_ERROR_TEXT);
4535
4535
  }
4536
4536
  return baseIsNative(value);
4537
4537
  }
@@ -5072,7 +5072,7 @@ var lodash = { exports: {} };
5072
5072
  if (!variable) {
5073
5073
  source = "with (obj) {\n" + source + "\n}\n";
5074
5074
  } else if (reForbiddenIdentifierChars.test(variable)) {
5075
- throw new Error(INVALID_TEMPL_VAR_ERROR_TEXT);
5075
+ throw new Error2(INVALID_TEMPL_VAR_ERROR_TEXT);
5076
5076
  }
5077
5077
  source = (isEvaluating ? source.replace(reEmptyStringLeading, "") : source).replace(reEmptyStringMiddle, "$1").replace(reEmptyStringTrailing, "$1;");
5078
5078
  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}";
@@ -5191,7 +5191,7 @@ var lodash = { exports: {} };
5191
5191
  try {
5192
5192
  return apply(func, undefined$1, args);
5193
5193
  } catch (e) {
5194
- return isError(e) ? e : new Error(e);
5194
+ return isError(e) ? e : new Error2(e);
5195
5195
  }
5196
5196
  });
5197
5197
  var bindAll = flatRest(function(object, methodNames) {
@@ -7614,7 +7614,7 @@ const refreshPage = (type, store2) => {
7614
7614
  Validation: ValidationSection
7615
7615
  };
7616
7616
  const elements = (_a = sectionLabels[type]) == null ? void 0 : _a.map((e) => sectionUiSchema[e]);
7617
- UiSchema.elements[1].config.main.tabLabels = sectionLabels[type] || ["Core", "style", "Event", "Validation"];
7617
+ UiSchema.elements[1].config.main.tabLabels = sectionLabels[type] || ["Core", "Style", "Event", "Validation"];
7618
7618
  UiSchema.elements[1].elements = elements || [CoreSection, StyleSection, EventSection, ValidationSection];
7619
7619
  }
7620
7620
  store2.setUiSchema(UiSchema);
@@ -8569,6 +8569,7 @@ function getRefreshElements(eventConfig, eventGropus) {
8569
8569
  result.push(result[0]);
8570
8570
  }
8571
8571
  }
8572
+ console.log(result);
8572
8573
  return result;
8573
8574
  }
8574
8575
  function executeRefreshHandler(params2) {
@@ -8695,12 +8696,16 @@ const buildHeadersFormat = (headers2) => {
8695
8696
  return headerObj;
8696
8697
  };
8697
8698
  function shouldEventExecute(params2) {
8698
- var _a, _b;
8699
+ var _a, _b, _c;
8699
8700
  const startEvent = (_b = (_a = params2.config) == null ? void 0 : _a.events) == null ? void 0 : _b.filter((e) => e.eventType === "onStart");
8700
8701
  if ((startEvent == null ? void 0 : startEvent.length) > 0) {
8701
- return executeEventsHandler({ ...params2, config: startEvent[0] }).then((response) => {
8702
- return response;
8703
- });
8702
+ if (((_c = startEvent[0]) == null ? void 0 : _c.isSync) !== "Yes") {
8703
+ return executeEventsHandler({ ...params2, config: startEvent[0] }).then((response) => {
8704
+ return response;
8705
+ });
8706
+ } else {
8707
+ return executeEventsHandler({ ...params2, config: startEvent[0] });
8708
+ }
8704
8709
  } else {
8705
8710
  if (params2.config.isSync !== "Yes") {
8706
8711
  return Promise.resolve(true);
@@ -8724,6 +8729,16 @@ function buildApiPayload(compConfig, body, headers, store, dynamicData, userValu
8724
8729
  }
8725
8730
  return promiseChain;
8726
8731
  }
8732
+ function asyncOperation() {
8733
+ return new Promise((resolve, reject) => {
8734
+ setTimeout(() => {
8735
+ {
8736
+ resolve("Operation completed successfully!");
8737
+ reject(new Error("Operation failed!"));
8738
+ }
8739
+ }, 50);
8740
+ });
8741
+ }
8727
8742
  let compType;
8728
8743
  let eventGroups = {};
8729
8744
  const notifyUiSchema = {
@@ -8768,6 +8783,8 @@ const extractEvents = (eventConfig) => {
8768
8783
  return eventGroups;
8769
8784
  };
8770
8785
  var service = (funcParams) => {
8786
+ eventGroups = {};
8787
+ eventGroups = extractEvents(funcParams.config);
8771
8788
  let executeEventsParameters = {
8772
8789
  config: {},
8773
8790
  componentName: "",
@@ -8775,47 +8792,23 @@ var service = (funcParams) => {
8775
8792
  dynamicData: funcParams.dynamicData,
8776
8793
  userValue: funcParams.userValue,
8777
8794
  service: funcParams.service,
8778
- serviceHolder: { downloadFile: downloadFile$1, download: doDownload, ...funcParams.functionsProvider },
8779
- eventGroups,
8780
- functionsProvider: funcParams.functionsProvider
8795
+ serviceHolder: { downloadFile: downloadFile$1, download: doDownload },
8796
+ eventGroups
8781
8797
  };
8782
8798
  return {
8783
8799
  setPage: async function() {
8784
- var _a, _b;
8785
8800
  funcParams.store.setFormdata({});
8786
- const data = JSON.stringify({
8787
- pageName: funcParams.store.pageName
8788
- });
8789
- let pageData;
8790
- const pageBasicDetailString = localStorage.getItem("pagemasterMetaData");
8791
- if (pageBasicDetailString) {
8792
- pageData = JSON.parse(pageBasicDetailString);
8793
- } else {
8794
- const pageId = await funcParams.service.post("/page/getByName", data, {
8795
- headers: {
8796
- "Content-Type": "application/json"
8797
- }
8798
- });
8799
- const response = await funcParams.service.get(
8800
- `/page/getById?id=${(_a = pageId == null ? void 0 : pageId.data) == null ? void 0 : _a.id}`,
8801
- {
8802
- headers: {
8803
- "Content-Type": "application/json"
8804
- }
8805
- }
8806
- );
8807
- pageData = response.data;
8808
- localStorage.setItem("pagemasterMetaData", JSON.stringify({
8809
- schema: pageData == null ? void 0 : pageData.schema,
8810
- uiSchema: pageData == null ? void 0 : pageData.uiSchema,
8811
- config: pageData == null ? void 0 : pageData.config
8812
- }));
8813
- }
8814
- const config = pageData == null ? void 0 : pageData.config;
8815
- const uiSchema = pageData == null ? void 0 : pageData.uiSchema;
8816
- const schema2 = (_b = pageData == null ? void 0 : pageData.schema) != null ? _b : { type: "object", properties: {} };
8817
- eventGroups = {};
8818
- eventGroups = extractEvents(config);
8801
+ funcParams.store.setSchema(
8802
+ (pre) => {
8803
+ return {
8804
+ ...funcParams.schema,
8805
+ properties: { ...funcParams.schema.properties, ...pre.properties }
8806
+ };
8807
+ }
8808
+ );
8809
+ funcParams.uiSchema.elements.push(notifyUiSchema);
8810
+ funcParams.store.setUiSchema(funcParams.uiSchema);
8811
+ await asyncOperation();
8819
8812
  executeEventsParameters = {
8820
8813
  config: {},
8821
8814
  componentName: "",
@@ -8823,7 +8816,6 @@ var service = (funcParams) => {
8823
8816
  dynamicData: funcParams.dynamicData,
8824
8817
  userValue: funcParams.userValue,
8825
8818
  service: funcParams.service,
8826
- functionsProvider: funcParams.functionsProvider,
8827
8819
  serviceHolder: this,
8828
8820
  eventGroups
8829
8821
  };
@@ -8837,46 +8829,15 @@ var service = (funcParams) => {
8837
8829
  serviceHolder: this,
8838
8830
  eventGroups
8839
8831
  });
8840
- funcParams.store.setSchema(
8841
- (pre) => {
8842
- return {
8843
- ...schema2,
8844
- properties: { ...schema2.properties, ...pre.properties }
8845
- };
8846
- }
8847
- );
8848
- uiSchema.elements.push(notifyUiSchema);
8849
- funcParams.store.setUiSchema(uiSchema);
8850
8832
  },
8851
- onCellRenderer: (cellParams) => {
8852
- var _a;
8853
- let finalResponse = {};
8854
- const path = ((_a = funcParams.dynamicData) == null ? void 0 : _a.tableButtonPath) || funcParams.dynamicData.path.split(".")[0];
8855
- for (const eventConfig of eventGroups == null ? void 0 : eventGroups.onCellRenderer[path]) {
8856
- executeEventsParameters.store.functionParameters = cellParams;
8857
- finalResponse = executeEvents({
8858
- ...executeEventsParameters,
8859
- config: eventConfig,
8860
- componentName: path
8861
- });
8862
- }
8863
- console.log("finalResponse >> >> >> ", finalResponse);
8864
- return finalResponse;
8865
- },
8866
- onClick: function() {
8867
- this.callHandler("onClick");
8868
- },
8869
- onMount: function() {
8870
- this.callHandler("onMount");
8833
+ onClick: async function() {
8834
+ await this.callHandler("onClick");
8871
8835
  },
8872
- onFileDownload: function() {
8873
- this.callHandler("onDownload");
8836
+ onFileDownload: async function() {
8837
+ await this.callHandler("onDownload");
8874
8838
  },
8875
- onFileUpload: function() {
8876
- this.callHandler("onUpload");
8877
- },
8878
- backHandler: function() {
8879
- funcParams.store.navigate(-1);
8839
+ onFileUpload: async function() {
8840
+ await this.callHandler("onUpload");
8880
8841
  },
8881
8842
  onPaginationChange: async function(paginationValues) {
8882
8843
  var _a;
@@ -8896,8 +8857,7 @@ var service = (funcParams) => {
8896
8857
  { key: "searchValue", value: param.serachValue },
8897
8858
  { key: "currentValue", value: param.currentValue }
8898
8859
  ];
8899
- const response = await this.updateConfigApiBody(param, apiBody);
8900
- return response == null ? void 0 : response.data;
8860
+ return await this.updateConfigApiBody(param, apiBody);
8901
8861
  }
8902
8862
  },
8903
8863
  onChange: async function() {
@@ -8971,7 +8931,7 @@ var service = (funcParams) => {
8971
8931
  if (((_b = eventGroups == null ? void 0 : eventGroups[eventType]) == null ? void 0 : _b[path]) !== void 0) {
8972
8932
  for (const eventConfig of (_c = eventGroups == null ? void 0 : eventGroups[eventType]) == null ? void 0 : _c[path]) {
8973
8933
  executeEventsParameters.store.functionParameters = functionParameters;
8974
- executeEvents({
8934
+ await executeEvents({
8975
8935
  ...executeEventsParameters,
8976
8936
  config: eventConfig,
8977
8937
  componentName: path
@@ -8980,8 +8940,7 @@ var service = (funcParams) => {
8980
8940
  }
8981
8941
  },
8982
8942
  downloadFile: downloadFile$1,
8983
- download: doDownload,
8984
- ...funcParams.functionsProvider
8943
+ download: doDownload
8985
8944
  };
8986
8945
  };
8987
8946
  var leaderBoard = {