impaktapps-ui-builder 0.0.409-l → 0.0.409-n

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);
@@ -8369,6 +8369,18 @@ const refreshSectionUiSchema = {
8369
8369
  }
8370
8370
  ]
8371
8371
  };
8372
+ var emptyBox = {
8373
+ type: "Control",
8374
+ scope: "#/properties/emptyBox",
8375
+ options: {
8376
+ widget: "EmptyBox"
8377
+ },
8378
+ config: {
8379
+ layout: { xs: 12, sm: 12, md: 5.5, lg: 5.5 },
8380
+ main: {},
8381
+ style: {}
8382
+ }
8383
+ };
8372
8384
  var event = (store2, dynamicData2, submitHandler, service2, functionsName) => {
8373
8385
  return {
8374
8386
  setPage: async function() {
@@ -8384,7 +8396,8 @@ var event = (store2, dynamicData2, submitHandler, service2, functionsName) => {
8384
8396
  if (handlerType) {
8385
8397
  if (handlerType === "custom") {
8386
8398
  uiSchema.elements[1].elements[0].elements[2] = getRadioInputField("isSync", "Run in Sync", ["Yes", "No"]);
8387
- uiSchema.elements[1].elements[0].elements[3] = getTextArea("eventCode", "Write Custom Code", false);
8399
+ uiSchema.elements[1].elements[0].elements[3] = emptyBox;
8400
+ uiSchema.elements[1].elements[0].elements[4] = getTextArea("eventCode", "Write Custom Code", false);
8388
8401
  schema2.required = ["eventType", "Handler", "eventCode"];
8389
8402
  } else if (handlerType === "api") {
8390
8403
  uiSchema.elements[1].elements[0].elements[2] = APISection;
@@ -8569,6 +8582,7 @@ function getRefreshElements(eventConfig, eventGropus) {
8569
8582
  result.push(result[0]);
8570
8583
  }
8571
8584
  }
8585
+ console.log(result);
8572
8586
  return result;
8573
8587
  }
8574
8588
  function executeRefreshHandler(params2) {
@@ -8695,12 +8709,16 @@ const buildHeadersFormat = (headers2) => {
8695
8709
  return headerObj;
8696
8710
  };
8697
8711
  function shouldEventExecute(params2) {
8698
- var _a, _b;
8712
+ var _a, _b, _c;
8699
8713
  const startEvent = (_b = (_a = params2.config) == null ? void 0 : _a.events) == null ? void 0 : _b.filter((e) => e.eventType === "onStart");
8700
8714
  if ((startEvent == null ? void 0 : startEvent.length) > 0) {
8701
- return executeEventsHandler({ ...params2, config: startEvent[0] }).then((response) => {
8702
- return response;
8703
- });
8715
+ if (((_c = startEvent[0]) == null ? void 0 : _c.isSync) !== "Yes") {
8716
+ return executeEventsHandler({ ...params2, config: startEvent[0] }).then((response) => {
8717
+ return response;
8718
+ });
8719
+ } else {
8720
+ return executeEventsHandler({ ...params2, config: startEvent[0] });
8721
+ }
8704
8722
  } else {
8705
8723
  if (params2.config.isSync !== "Yes") {
8706
8724
  return Promise.resolve(true);
@@ -8724,6 +8742,16 @@ function buildApiPayload(compConfig, body, headers, store, dynamicData, userValu
8724
8742
  }
8725
8743
  return promiseChain;
8726
8744
  }
8745
+ function asyncOperation() {
8746
+ return new Promise((resolve, reject) => {
8747
+ setTimeout(() => {
8748
+ {
8749
+ resolve("Operation completed successfully!");
8750
+ reject(new Error("Operation failed!"));
8751
+ }
8752
+ }, 50);
8753
+ });
8754
+ }
8727
8755
  let compType;
8728
8756
  let eventGroups = {};
8729
8757
  const notifyUiSchema = {
@@ -8768,6 +8796,8 @@ const extractEvents = (eventConfig) => {
8768
8796
  return eventGroups;
8769
8797
  };
8770
8798
  var service = (funcParams) => {
8799
+ eventGroups = {};
8800
+ eventGroups = extractEvents(funcParams.config);
8771
8801
  let executeEventsParameters = {
8772
8802
  config: {},
8773
8803
  componentName: "",
@@ -8775,47 +8805,23 @@ var service = (funcParams) => {
8775
8805
  dynamicData: funcParams.dynamicData,
8776
8806
  userValue: funcParams.userValue,
8777
8807
  service: funcParams.service,
8778
- serviceHolder: { downloadFile: downloadFile$1, download: doDownload, ...funcParams.functionsProvider },
8779
- eventGroups,
8780
- functionsProvider: funcParams.functionsProvider
8808
+ serviceHolder: { downloadFile: downloadFile$1, download: doDownload },
8809
+ eventGroups
8781
8810
  };
8782
8811
  return {
8783
8812
  setPage: async function() {
8784
- var _a, _b;
8785
8813
  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);
8814
+ funcParams.store.setSchema(
8815
+ (pre) => {
8816
+ return {
8817
+ ...funcParams.schema,
8818
+ properties: { ...funcParams.schema.properties, ...pre.properties }
8819
+ };
8820
+ }
8821
+ );
8822
+ funcParams.uiSchema.elements.push(notifyUiSchema);
8823
+ funcParams.store.setUiSchema(funcParams.uiSchema);
8824
+ await asyncOperation();
8819
8825
  executeEventsParameters = {
8820
8826
  config: {},
8821
8827
  componentName: "",
@@ -8823,7 +8829,6 @@ var service = (funcParams) => {
8823
8829
  dynamicData: funcParams.dynamicData,
8824
8830
  userValue: funcParams.userValue,
8825
8831
  service: funcParams.service,
8826
- functionsProvider: funcParams.functionsProvider,
8827
8832
  serviceHolder: this,
8828
8833
  eventGroups
8829
8834
  };
@@ -8837,46 +8842,15 @@ var service = (funcParams) => {
8837
8842
  serviceHolder: this,
8838
8843
  eventGroups
8839
8844
  });
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
- },
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
8845
  },
8869
- onMount: function() {
8870
- this.callHandler("onMount");
8846
+ onClick: async function() {
8847
+ await this.callHandler("onClick");
8871
8848
  },
8872
- onFileDownload: function() {
8873
- this.callHandler("onDownload");
8849
+ onFileDownload: async function() {
8850
+ await this.callHandler("onDownload");
8874
8851
  },
8875
- onFileUpload: function() {
8876
- this.callHandler("onUpload");
8877
- },
8878
- backHandler: function() {
8879
- funcParams.store.navigate(-1);
8852
+ onFileUpload: async function() {
8853
+ await this.callHandler("onUpload");
8880
8854
  },
8881
8855
  onPaginationChange: async function(paginationValues) {
8882
8856
  var _a;
@@ -8896,8 +8870,7 @@ var service = (funcParams) => {
8896
8870
  { key: "searchValue", value: param.serachValue },
8897
8871
  { key: "currentValue", value: param.currentValue }
8898
8872
  ];
8899
- const response = await this.updateConfigApiBody(param, apiBody);
8900
- return response == null ? void 0 : response.data;
8873
+ return await this.updateConfigApiBody(param, apiBody);
8901
8874
  }
8902
8875
  },
8903
8876
  onChange: async function() {
@@ -8971,7 +8944,7 @@ var service = (funcParams) => {
8971
8944
  if (((_b = eventGroups == null ? void 0 : eventGroups[eventType]) == null ? void 0 : _b[path]) !== void 0) {
8972
8945
  for (const eventConfig of (_c = eventGroups == null ? void 0 : eventGroups[eventType]) == null ? void 0 : _c[path]) {
8973
8946
  executeEventsParameters.store.functionParameters = functionParameters;
8974
- executeEvents({
8947
+ await executeEvents({
8975
8948
  ...executeEventsParameters,
8976
8949
  config: eventConfig,
8977
8950
  componentName: path
@@ -8980,8 +8953,7 @@ var service = (funcParams) => {
8980
8953
  }
8981
8954
  },
8982
8955
  downloadFile: downloadFile$1,
8983
- download: doDownload,
8984
- ...funcParams.functionsProvider
8956
+ download: doDownload
8985
8957
  };
8986
8958
  };
8987
8959
  var leaderBoard = {
@@ -10624,18 +10596,6 @@ const buildRadio = (config, componentScope) => {
10624
10596
  }
10625
10597
  return Radio;
10626
10598
  };
10627
- var emptyBox = {
10628
- type: "Control",
10629
- scope: "#/properties/emptyBox",
10630
- options: {
10631
- widget: "EmptyBox"
10632
- },
10633
- config: {
10634
- layout: { xs: 12, sm: 12, md: 5.5, lg: 5.5 },
10635
- main: {},
10636
- style: {}
10637
- }
10638
- };
10639
10599
  const buildEmptyBox = (config, componentScope) => {
10640
10600
  const EmptyBox2 = _.cloneDeep(emptyBox);
10641
10601
  if (config.layout) {