impaktapps-ui-builder 0.0.286 → 0.0.288

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.
@@ -6379,34 +6379,34 @@ const CoreSection = {
6379
6379
  label: "Type",
6380
6380
  type: "text",
6381
6381
  options: [
6382
- { title: "Select", const: "Select" },
6383
- { title: "Date", const: "Date" },
6384
- { title: "CheckBox", const: "CheckBox" },
6385
- { title: "Table", const: "Table" },
6386
- { title: "Lazy Loading Table", const: "LazyLoadingTable" },
6387
- { title: "Array", const: "Array" },
6388
- { title: "Container", const: "WrapperSection" },
6389
- { title: "Tabs", const: "TabSection" },
6390
- { title: "Text", const: "Text" },
6391
- { title: "Text Area", const: "TextArea" },
6392
- { title: "Button", const: "Button" },
6393
- { title: "Card", const: "card" },
6394
- { title: "Radio", const: "Radio" },
6395
- { title: "Rank", const: "Rank" },
6396
- { title: "SpeedoMeter", const: "SpeedoMeter" },
6397
- { title: "ProgressBar", const: "ProgressBar" },
6398
- { title: "Graph", const: "Graph" },
6399
- { title: "Label", const: "Box" },
6400
- { title: "Upload File", const: "UploadFile" },
6401
- { title: "Download File", const: "DownloadFile" },
6402
- { title: "Empty Box", const: "EmptyBox" },
6403
- { title: "ProgressBar Card", const: "ProgressBarCard" },
6404
- { title: "Rank Card", const: "RankCard" },
6405
- { title: "Runner Boy Progress Bar", const: "RunnerBoyProgressBar" },
6406
- { title: "Slider", const: "Slider" },
6407
- { title: "Timer", const: "Timer" },
6408
- { title: "MultipleSelect", const: "MultipleSelect" },
6409
- { title: "LeaderBoard", const: "LeaderBoard" }
6382
+ { label: "Select", value: "Select" },
6383
+ { label: "Date", value: "Date" },
6384
+ { label: "CheckBox", value: "CheckBox" },
6385
+ { label: "Table", value: "Table" },
6386
+ { label: "Lazy Loading Table", value: "LazyLoadingTable" },
6387
+ { label: "Array", value: "Array" },
6388
+ { label: "Container", value: "WrapperSection" },
6389
+ { label: "Tabs", value: "TabSection" },
6390
+ { label: "Text", value: "Text" },
6391
+ { label: "Text Area", value: "TextArea" },
6392
+ { label: "Button", value: "Button" },
6393
+ { label: "Card", value: "card" },
6394
+ { label: "Radio", value: "Radio" },
6395
+ { label: "Rank", value: "Rank" },
6396
+ { label: "SpeedoMeter", value: "SpeedoMeter" },
6397
+ { label: "ProgressBar", value: "ProgressBar" },
6398
+ { label: "Graph", value: "Graph" },
6399
+ { label: "Label", value: "Box" },
6400
+ { label: "Upload File", value: "UploadFile" },
6401
+ { label: "Download File", value: "DownloadFile" },
6402
+ { label: "Empty Box", value: "EmptyBox" },
6403
+ { label: "ProgressBar Card", value: "ProgressBarCard" },
6404
+ { label: "Rank Card", value: "RankCard" },
6405
+ { label: "Runner Boy Progress Bar", value: "RunnerBoyProgressBar" },
6406
+ { label: "Slider", value: "Slider" },
6407
+ { label: "Timer", value: "Timer" },
6408
+ { label: "MultipleSelect", value: "MultipleSelect" },
6409
+ { label: "LeaderBoard", value: "LeaderBoard" }
6410
6410
  ]
6411
6411
  }
6412
6412
  }
@@ -6482,10 +6482,10 @@ const CoreSection = {
6482
6482
  main: {
6483
6483
  label: "Screen Size",
6484
6484
  options: [
6485
- { title: "Extra Small", const: "xs" },
6486
- { title: "Small", const: "sm" },
6487
- { title: "Medium", const: "md" },
6488
- { title: "Large", const: "lg" }
6485
+ { label: "Extra Small", value: "xs" },
6486
+ { label: "Small", value: "sm" },
6487
+ { label: "Medium", value: "md" },
6488
+ { label: "Large", value: "lg" }
6489
6489
  ]
6490
6490
  }
6491
6491
  }
@@ -6506,10 +6506,10 @@ const CoreSection = {
6506
6506
  main: {
6507
6507
  label: "Value",
6508
6508
  options: [
6509
- { title: "3", const: "3" },
6510
- { title: "5.5", const: "5.5" },
6511
- { title: "8", const: "8" },
6512
- { title: "12", const: "12" }
6509
+ { label: "3", value: "3" },
6510
+ { label: "5.5", value: "5.5" },
6511
+ { label: "8", value: "8" },
6512
+ { label: "12", value: "12" }
6513
6513
  ]
6514
6514
  }
6515
6515
  }
@@ -7132,10 +7132,10 @@ const ValidationSection = {
7132
7132
  main: {
7133
7133
  label: "Validation Type",
7134
7134
  options: [
7135
- { const: "required", title: "Required" },
7136
- { const: "minLength", title: "Minimum Length" },
7137
- { const: "maxLength", title: "Maximum Length" },
7138
- { const: "pattern", title: "Pattern" }
7135
+ { value: "required", label: "Required" },
7136
+ { value: "minLength", label: "Minimum Length" },
7137
+ { value: "maxLength", label: "Maximum Length" },
7138
+ { value: "pattern", label: "Pattern" }
7139
7139
  ]
7140
7140
  }
7141
7141
  }
@@ -9491,10 +9491,10 @@ const APISection = {
9491
9491
  label: "Method",
9492
9492
  type: "text",
9493
9493
  options: [
9494
- { title: "Get", const: "get" },
9495
- { title: "Post", const: "post" },
9496
- { title: "Delete", const: "delete" },
9497
- { title: "Put", const: "put" }
9494
+ { label: "Get", value: "get" },
9495
+ { label: "Post", value: "post" },
9496
+ { label: "Delete", value: "delete" },
9497
+ { label: "Put", value: "put" }
9498
9498
  ]
9499
9499
  }
9500
9500
  }
@@ -9739,16 +9739,16 @@ const downloadFile = (obj) => {
9739
9739
  const executeEvents = async (params2) => {
9740
9740
  var _a, _b, _c;
9741
9741
  let nextEvent = [];
9742
- let LoadResponse = null;
9742
+ let finalResponse = null;
9743
9743
  try {
9744
9744
  if (!shouldEventExecute(params2)) {
9745
9745
  return { response: void 0, events: void 0 };
9746
9746
  }
9747
9747
  const response2 = await executeEventsHandler(params2);
9748
- LoadResponse = response2;
9748
+ finalResponse = response2;
9749
9749
  const SuccessEvent = (_a = params2.config) == null ? void 0 : _a.events.filter((e) => e.eventType === "Success");
9750
9750
  if (params2.config.returnNeeded) {
9751
- return LoadResponse;
9751
+ return finalResponse;
9752
9752
  }
9753
9753
  nextEvent = SuccessEvent;
9754
9754
  } catch (err) {
@@ -9758,10 +9758,10 @@ const executeEvents = async (params2) => {
9758
9758
  }
9759
9759
  if ((nextEvent == null ? void 0 : nextEvent.length) > 0) {
9760
9760
  for (const actionConfig of nextEvent) {
9761
- await executeEvents({ ...params2, config: actionConfig, parentEventOutput: LoadResponse });
9761
+ await executeEvents({ ...params2, config: actionConfig, parentEventOutput: finalResponse });
9762
9762
  }
9763
9763
  }
9764
- return LoadResponse;
9764
+ return finalResponse;
9765
9765
  };
9766
9766
  async function executeEventsHandler(params2) {
9767
9767
  if (params2.config.Handler === "api") {
@@ -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
- enum: handlerResponse.data
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 { response: response2 } = await executeEventsHandler(params2);
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 executeEvents({
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, _b;
10009
- for (const eventConfig of eventGroups == null ? void 0 : eventGroups.onLoad[paginationValues.path]) {
10010
- const bodyValues = [
10011
- { key: "size", value: paginationValues.pagination.pageSize },
10012
- { key: "start", value: paginationValues.pagination.pageIndex * paginationValues.pagination.pageSize },
10013
- { key: "sorting", value: paginationValues.sorting || [] },
10014
- { key: "filters", value: paginationValues.columnFilters || [] },
10015
- { key: "globalFilter", value: (_a = paginationValues.globalFilter) != null ? _a : "" }
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
- if (eventConfig.body) {
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
  };