impaktapps-ui-builder 0.0.275 → 0.0.276

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.
Files changed (39) hide show
  1. package/dist/impaktapps-ui-builder.es.js +393 -120
  2. package/dist/impaktapps-ui-builder.es.js.map +1 -1
  3. package/dist/impaktapps-ui-builder.umd.js +16 -16
  4. package/dist/impaktapps-ui-builder.umd.js.map +1 -1
  5. package/dist/src/impaktapps-ui-builder/builder/build/buildConfig.d.ts +1 -0
  6. package/dist/src/impaktapps-ui-builder/builder/build/buildLineGraph.d.ts +1 -0
  7. package/dist/src/impaktapps-ui-builder/builder/build/buildRadio.d.ts +1 -0
  8. package/dist/src/impaktapps-ui-builder/builder/build/buildSchema.d.ts +6 -0
  9. package/dist/src/impaktapps-ui-builder/builder/build/buildUiSchema.d.ts +0 -4
  10. package/dist/src/impaktapps-ui-builder/builder/build/uischema/cardSlider.d.ts +1 -6
  11. package/dist/src/impaktapps-ui-builder/builder/build/uischema/leaderBoard.d.ts +8 -1
  12. package/dist/src/impaktapps-ui-builder/builder/build/uischema/speedoMeter.d.ts +9 -3
  13. package/dist/src/impaktapps-ui-builder/builder/build/uischema/validationSections.d.ts +31 -0
  14. package/dist/src/impaktapps-ui-builder/lib/index.d.ts +1 -0
  15. package/package.json +1 -1
  16. package/src/impaktapps-ui-builder/builder/build/buildCard.ts +14 -7
  17. package/src/impaktapps-ui-builder/builder/build/buildConfig.ts +10 -0
  18. package/src/impaktapps-ui-builder/builder/build/buildHorizontalBarGraph.ts +4 -2
  19. package/src/impaktapps-ui-builder/builder/build/buildLineGraph.ts +28 -21
  20. package/src/impaktapps-ui-builder/builder/build/buildPieGraph.ts +12 -16
  21. package/src/impaktapps-ui-builder/builder/build/buildRadio.ts +35 -0
  22. package/src/impaktapps-ui-builder/builder/build/buildSchema.ts +34 -0
  23. package/src/impaktapps-ui-builder/builder/build/buildSpeedoMeter.ts +21 -8
  24. package/src/impaktapps-ui-builder/builder/build/buildStackBarGraph.ts +2 -1
  25. package/src/impaktapps-ui-builder/builder/build/buildTimer.ts +2 -1
  26. package/src/impaktapps-ui-builder/builder/build/buildUiSchema.ts +44 -37
  27. package/src/impaktapps-ui-builder/builder/build/uischema/buildPropertiesSection.ts +53 -45
  28. package/src/impaktapps-ui-builder/builder/build/uischema/cardSlider.ts +1 -1
  29. package/src/impaktapps-ui-builder/builder/build/uischema/coreSection.ts +1 -0
  30. package/src/impaktapps-ui-builder/builder/build/uischema/leaderBoard.ts +4 -1
  31. package/src/impaktapps-ui-builder/builder/build/uischema/speedoMeter.ts +5 -4
  32. package/src/impaktapps-ui-builder/builder/build/uischema/validationSections.ts +75 -0
  33. package/src/impaktapps-ui-builder/builder/elements/UiSchema/Component/schema.ts +41 -0
  34. package/src/impaktapps-ui-builder/builder/elements/UiSchema/Component/uiSchema.ts +2 -1
  35. package/src/impaktapps-ui-builder/builder/elements/UiSchema/event/uiSchema.ts +1 -0
  36. package/src/impaktapps-ui-builder/builder/services/component.ts +27 -24
  37. package/src/impaktapps-ui-builder/lib/index.ts +1 -0
  38. package/src/impaktapps-ui-builder/runtime/services/events.ts +86 -4
  39. package/src/impaktapps-ui-builder/runtime/services/service.ts +1 -0
@@ -4531,7 +4531,7 @@ var lodash = { exports: {} };
4531
4531
  customizer = typeof customizer == "function" ? customizer : undefined$1;
4532
4532
  return baseIsMatch(object, source, getMatchData(source), customizer);
4533
4533
  }
4534
- function isNaN(value) {
4534
+ function isNaN2(value) {
4535
4535
  return isNumber(value) && value != +value;
4536
4536
  }
4537
4537
  function isNative(value) {
@@ -5608,7 +5608,7 @@ var lodash = { exports: {} };
5608
5608
  lodash2.isMap = isMap;
5609
5609
  lodash2.isMatch = isMatch;
5610
5610
  lodash2.isMatchWith = isMatchWith;
5611
- lodash2.isNaN = isNaN;
5611
+ lodash2.isNaN = isNaN2;
5612
5612
  lodash2.isNative = isNative;
5613
5613
  lodash2.isNil = isNil;
5614
5614
  lodash2.isNull = isNull;
@@ -5948,6 +5948,45 @@ const ComponentSchema = {
5948
5948
  }
5949
5949
  }
5950
5950
  }
5951
+ },
5952
+ legendLabels: {
5953
+ type: "array",
5954
+ items: {
5955
+ type: "object",
5956
+ properties: {
5957
+ label: {
5958
+ type: "string"
5959
+ }
5960
+ }
5961
+ }
5962
+ },
5963
+ pieArcColors: {
5964
+ type: "array",
5965
+ items: {
5966
+ type: "object",
5967
+ properties: {
5968
+ label: {
5969
+ type: "string"
5970
+ }
5971
+ }
5972
+ }
5973
+ },
5974
+ validation: {
5975
+ type: "array",
5976
+ items: {
5977
+ type: "object",
5978
+ properties: {
5979
+ componentName: {
5980
+ type: "string"
5981
+ },
5982
+ validationType: {
5983
+ type: "string"
5984
+ },
5985
+ validationValue: {
5986
+ type: "string"
5987
+ }
5988
+ }
5989
+ }
5951
5990
  }
5952
5991
  }
5953
5992
  };
@@ -6028,7 +6067,7 @@ const componentBasicUiSchema = {
6028
6067
  main: {
6029
6068
  tabLabels: ["Core"],
6030
6069
  defaultStyle: true,
6031
- id: "component"
6070
+ id: `component`
6032
6071
  }
6033
6072
  },
6034
6073
  elements: [
@@ -6054,6 +6093,7 @@ const componentBasicUiSchema = {
6054
6093
  { label: "Container", value: "WrapperSection" },
6055
6094
  { label: "Tabs", value: "TabSection" },
6056
6095
  { label: "Text", value: "Text" },
6096
+ { label: "Radio", value: "Radio" },
6057
6097
  { label: "Text Area", value: "TextArea" },
6058
6098
  { label: "Button", value: "Button" },
6059
6099
  { label: "Card", value: "card" },
@@ -6263,6 +6303,13 @@ const createLayoutFormat = (config) => {
6263
6303
  });
6264
6304
  return data2;
6265
6305
  };
6306
+ const flatObjectValueInArray = (config) => {
6307
+ const keyName = Object.keys(config[0])[0];
6308
+ const data2 = config.map((e) => {
6309
+ return e[keyName];
6310
+ });
6311
+ return data2;
6312
+ };
6266
6313
  const getNavigationHistory = (config, path) => {
6267
6314
  if (path) {
6268
6315
  let urlRoutes = config.name;
@@ -6336,6 +6383,7 @@ const CoreSection = {
6336
6383
  { label: "Text Area", value: "TextArea" },
6337
6384
  { label: "Button", value: "Button" },
6338
6385
  { label: "Card", value: "card" },
6386
+ { label: "Radio", value: "Radio" },
6339
6387
  { label: "Rank", value: "Rank" },
6340
6388
  { label: "SpeedoMeter", value: "SpeedoMeter" },
6341
6389
  { label: "ProgressBar", value: "ProgressBar" },
@@ -6629,6 +6677,38 @@ const EventSection = {
6629
6677
  }
6630
6678
  ]
6631
6679
  };
6680
+ const getArrayControl = (parentScope, childScope, childLabel) => {
6681
+ return {
6682
+ type: "Control",
6683
+ scope: `#/properties/${parentScope}`,
6684
+ layout: 11.5,
6685
+ options: {
6686
+ detail: {
6687
+ type: "HorizontalLayout",
6688
+ elements: [
6689
+ {
6690
+ type: "Control",
6691
+ scope: `#/properties/${childScope}`,
6692
+ options: {
6693
+ widget: "InputField"
6694
+ },
6695
+ config: {
6696
+ layout: {
6697
+ xs: 11,
6698
+ sm: 11,
6699
+ md: 5.5,
6700
+ lg: 5.5
6701
+ },
6702
+ main: {
6703
+ label: childLabel || "Labels for Tab"
6704
+ }
6705
+ }
6706
+ }
6707
+ ]
6708
+ }
6709
+ }
6710
+ };
6711
+ };
6632
6712
  const getInputField = (scope, label) => {
6633
6713
  return {
6634
6714
  type: "Control",
@@ -6720,7 +6800,15 @@ const GraphSection = {
6720
6800
  };
6721
6801
  const buildPropertiesSection = function(type) {
6722
6802
  let uiSchema = _.cloneDeep(GraphSection);
6723
- if (type === "SpeedoMeter" || type === "RankCard" || type === "Timer") {
6803
+ if (type === "SpeedoMeter") {
6804
+ uiSchema.elements = [
6805
+ getInputField("segments", "Segments Count"),
6806
+ getInputField("heading", "Container Heading"),
6807
+ getInputField("heading", "Container Heading"),
6808
+ getInputField("speedoCaption", "Speedometer Caption"),
6809
+ getInputField("width", "Speedometer Width")
6810
+ ];
6811
+ } else if (type === "RankCard") {
6724
6812
  uiSchema.elements = [
6725
6813
  getInputField("rank", "Rank"),
6726
6814
  getInputField("image", "Image Url"),
@@ -6779,47 +6867,25 @@ const buildPropertiesSection = function(type) {
6779
6867
  getSelectField("graphType", "Graph Type", [
6780
6868
  { label: "Bar Graph", value: "BarGraph" },
6781
6869
  { label: "Stack Bar Graph", value: "StackBarGraph" },
6870
+ { label: "Line Graph", value: "LineGraph" },
6782
6871
  { label: "Pie Graph", value: "PieGraph" },
6783
6872
  { label: "Horizontal Bar Graph", value: "HorizontalBarGraph" }
6784
6873
  ]),
6785
6874
  leftLabel,
6786
6875
  bottomLabel,
6787
- legendAvailabe
6876
+ legendAvailabe,
6877
+ getArrayControl("legendLabels", "label"),
6878
+ getArrayControl("pieArcColors", "color")
6788
6879
  ];
6789
6880
  } else if (type === "WrapperSection") {
6790
6881
  uiSchema.elements = [getRadioInputField("divider", "Divider", ["YES", "No"]), getRadioInputField("heading", "Page Heading", ["YES", "No"])];
6791
6882
  } else if (type === "TabSection") {
6792
6883
  uiSchema.elements = [
6793
- {
6794
- type: "Control",
6795
- scope: "#/properties/sectionLabels",
6796
- layout: 11.5,
6797
- options: {
6798
- detail: {
6799
- type: "HorizontalLayout",
6800
- elements: [
6801
- {
6802
- type: "Control",
6803
- scope: "#/properties/label",
6804
- options: {
6805
- widget: "InputField"
6806
- },
6807
- config: {
6808
- layout: {
6809
- xs: 11,
6810
- sm: 11,
6811
- md: 5.5,
6812
- lg: 5.5
6813
- },
6814
- main: {
6815
- label: "Labels for Tab"
6816
- }
6817
- }
6818
- }
6819
- ]
6820
- }
6821
- }
6822
- }
6884
+ getArrayControl("sectionLabels", "label")
6885
+ ];
6886
+ } else if (type === "Radio") {
6887
+ uiSchema.elements = [
6888
+ getArrayControl("sectionLabels", "label", "Options Of Radio")
6823
6889
  ];
6824
6890
  }
6825
6891
  return uiSchema;
@@ -6982,27 +7048,82 @@ const ValueTab = {
6982
7048
  type: "HorizontalLayout",
6983
7049
  elements: [OptionArray]
6984
7050
  };
7051
+ const ValidationSection = {
7052
+ type: "HorizontalLayout",
7053
+ elements: [
7054
+ {
7055
+ type: "Control",
7056
+ scope: "#/properties/validation",
7057
+ layout: 11.5,
7058
+ options: {
7059
+ detail: {
7060
+ type: "HorizontalLayout",
7061
+ elements: [
7062
+ {
7063
+ type: "Control",
7064
+ scope: "#/properties/validationType",
7065
+ options: {
7066
+ widget: "InputField"
7067
+ },
7068
+ config: {
7069
+ layout: {
7070
+ xs: 11,
7071
+ sm: 11,
7072
+ md: 5.5,
7073
+ lg: 5.5
7074
+ },
7075
+ main: {
7076
+ label: "Validation Type"
7077
+ }
7078
+ }
7079
+ },
7080
+ {
7081
+ type: "Control",
7082
+ scope: "#/properties/validationValue",
7083
+ options: {
7084
+ widget: "InputField"
7085
+ },
7086
+ config: {
7087
+ layout: {
7088
+ xs: 11,
7089
+ sm: 11,
7090
+ md: 5.5,
7091
+ lg: 5.5
7092
+ },
7093
+ main: {
7094
+ label: "Validation Value"
7095
+ }
7096
+ }
7097
+ }
7098
+ ]
7099
+ }
7100
+ }
7101
+ }
7102
+ ]
7103
+ };
6985
7104
  const sectionLabels = {
6986
- Select: ["Core", "Value", "style", "Event"],
6987
- MultipleSelect: ["Core", "Value", "style", "Event"],
6988
- Table: ["Core", "Components", "style", "Event"],
6989
- LeaderBoard: ["Core", "Components", "Properties", "style", "Event"],
6990
- WrapperSection: ["Core", "Components", "Properties", "style"],
6991
- TabSection: ["Core", "Components", "Properties", "style"],
6992
- SpeedoMeter: ["Core", "Properties", "style", "Event"],
6993
- card: ["Core", "Properties", "style", "Event"],
6994
- UploadFile: ["Core", "style", "Event"],
6995
- Graph: ["Core", "Properties", "style", "Event"],
6996
- DownloadFile: ["Core", "style", "Event"],
6997
- Box: ["Core", "Properties", "style", "Event"],
6998
- Properties: ["Core", "Properties", "style", "Event"],
6999
- ProgressBarCard: ["Core", "Properties", "style", "Event"],
7000
- RankCard: ["Core", "Properties", "style", "Event"],
7001
- Slider: ["Core", "Components", "Properties", "style", "Event"],
7002
- Timer: ["Core", "Properties", "style", "Event"],
7003
- Rank: ["Core", "Properties", "style", "Event"],
7004
- Button: ["Core", "Properties", "style", "Event"],
7005
- Array: ["Core", "Components"]
7105
+ Select: ["Core", "Value", "style", "Event", "Validation"],
7106
+ MultipleSelect: ["Core", "Value", "style", "Event", "Validation"],
7107
+ Table: ["Core", "Components", "style", "Event", "Validation"],
7108
+ LeaderBoard: ["Core", "Components", "Properties", "style", "Event", "Validation"],
7109
+ WrapperSection: ["Core", "Components", "Properties", "style", "Validation"],
7110
+ TabSection: ["Core", "Components", "Properties", "style", "Validation"],
7111
+ SpeedoMeter: ["Core", "Properties", "style", "Event", "Validation"],
7112
+ card: ["Core", "Properties", "style", "Event", "Validation"],
7113
+ UploadFile: ["Core", "style", "Event", "Validation"],
7114
+ Graph: ["Core", "Properties", "style", "Event", "Validation"],
7115
+ DownloadFile: ["Core", "style", "Event", "Validation"],
7116
+ Box: ["Core", "Properties", "style", "Event", "Validation"],
7117
+ Properties: ["Core", "Properties", "style", "Event", "Validation"],
7118
+ ProgressBarCard: ["Core", "Properties", "style", "Event", "Validation"],
7119
+ RankCard: ["Core", "Properties", "style", "Event", "Validation"],
7120
+ Slider: ["Core", "Components", "Properties", "style", "Event", "Validation"],
7121
+ Timer: ["Core", "Properties", "style", "Event", "Validation"],
7122
+ Rank: ["Core", "Properties", "style", "Event", "Validation"],
7123
+ Button: ["Core", "Properties", "style", "Event", "Validation"],
7124
+ Array: ["Core", "Components", "Validation"],
7125
+ Radio: ["Core", "Properties", "style", "Event", "Validation"],
7126
+ Text: ["Core", "Event", "Validation"]
7006
7127
  };
7007
7128
  const refreshPage = (type, store2) => {
7008
7129
  var _a;
@@ -7014,11 +7135,12 @@ const refreshPage = (type, store2) => {
7014
7135
  style: StyleSection,
7015
7136
  Event: EventSection,
7016
7137
  Components: TableSection,
7017
- Properties: buildPropertiesSection(type)
7138
+ Properties: buildPropertiesSection(type),
7139
+ Validation: ValidationSection
7018
7140
  };
7019
7141
  const elements = (_a = sectionLabels[type]) == null ? void 0 : _a.map((e) => sectionUiSchema[e]);
7020
- UiSchema.elements[1].config.main.tabLabels = sectionLabels[type] || ["Core", "style", "Event"];
7021
- UiSchema.elements[1].elements = elements || [CoreSection, StyleSection, EventSection];
7142
+ UiSchema.elements[1].config.main.tabLabels = sectionLabels[type] || ["Core", "style", "Event", "Validation"];
7143
+ UiSchema.elements[1].elements = elements || [CoreSection, StyleSection, EventSection, ValidationSection];
7022
7144
  }
7023
7145
  store2.setUiSchema(UiSchema);
7024
7146
  };
@@ -7027,8 +7149,8 @@ var Component = (store2, dynamicData2) => {
7027
7149
  setPage: async function() {
7028
7150
  const formdata = await this.getFormdata();
7029
7151
  store2.setFormdata(formdata);
7030
- const schema = this.getSchema();
7031
- store2.setSchema(schema);
7152
+ const schema2 = this.getSchema();
7153
+ store2.setSchema(schema2);
7032
7154
  this.refreshPage(formdata == null ? void 0 : formdata.type, store2);
7033
7155
  },
7034
7156
  refreshPage,
@@ -7077,8 +7199,8 @@ var Component = (store2, dynamicData2) => {
7077
7199
  const path = (_a = store2.searchParams) == null ? void 0 : _a.get("path");
7078
7200
  const rowId = dynamicData2.path.split(".")[1];
7079
7201
  store2.formData.elements.splice(rowId, 1);
7080
- const response = saveFormdataInLocalStorage(store2.formData, path);
7081
- const data2 = path ? _.get(response, path) : response;
7202
+ const response2 = saveFormdataInLocalStorage(store2.formData, path);
7203
+ const data2 = path ? _.get(response2, path) : response2;
7082
7204
  store2.setFormdata(data2);
7083
7205
  },
7084
7206
  deleteEvent: async function() {
@@ -7086,8 +7208,8 @@ var Component = (store2, dynamicData2) => {
7086
7208
  const path = (_a = store2.searchParams) == null ? void 0 : _a.get("path");
7087
7209
  const rowId = dynamicData2.path.split(".")[1];
7088
7210
  store2.formData.events.splice(rowId, 1);
7089
- const response = saveFormdataInLocalStorage(store2.formData, path);
7090
- store2.setFormdata(_.get(response, path));
7211
+ const response2 = saveFormdataInLocalStorage(store2.formData, path);
7212
+ store2.setFormdata(_.get(response2, path));
7091
7213
  },
7092
7214
  widgetAddClickHandler: async function() {
7093
7215
  var _a;
@@ -7133,8 +7255,8 @@ var pageMaster = (funcParams) => {
7133
7255
  const formdata = await this.getFormdata();
7134
7256
  store2.setFormdata(formdata);
7135
7257
  const uiSchema = await this.getUiSchema();
7136
- const schema = await this.getSchema();
7137
- store2.setSchema(schema);
7258
+ const schema2 = await this.getSchema();
7259
+ store2.setSchema(schema2);
7138
7260
  store2.setUiSchema(uiSchema);
7139
7261
  },
7140
7262
  getFormdata: async function() {
@@ -7163,9 +7285,9 @@ var pageMaster = (funcParams) => {
7163
7285
  if (!Array.isArray(store2.formData.elements)) {
7164
7286
  store2.formData.elements = [];
7165
7287
  }
7166
- const response = saveFormdataInLocalStorage(store2.formData);
7288
+ const response2 = saveFormdataInLocalStorage(store2.formData);
7167
7289
  store2.navigate(
7168
- `/Component?path=${`elements[${response == null ? void 0 : response.elements.length}]`}&id=${id}`
7290
+ `/Component?path=${`elements[${response2 == null ? void 0 : response2.elements.length}]`}&id=${id}`
7169
7291
  );
7170
7292
  },
7171
7293
  submitPageHandler: async function() {
@@ -7201,8 +7323,8 @@ var pageMaster = (funcParams) => {
7201
7323
  deleteEvent: async function() {
7202
7324
  const rowId = dynamicData2.path.split(".")[1];
7203
7325
  store2.formData.events.splice(rowId, 1);
7204
- const response = saveFormdataInLocalStorage(store2.formData);
7205
- store2.setFormdata(response);
7326
+ const response2 = saveFormdataInLocalStorage(store2.formData);
7327
+ store2.setFormdata(response2);
7206
7328
  }
7207
7329
  };
7208
7330
  };
@@ -7347,6 +7469,7 @@ const EventUiSchema = {
7347
7469
  type: "text",
7348
7470
  options: [
7349
7471
  { label: "Click Event", value: "onClick" },
7472
+ { label: "onStart", value: "onStart" },
7350
7473
  { label: "Load Event", value: "onLoad" },
7351
7474
  { label: "Change Event", value: "onChange" },
7352
7475
  { label: "Success", value: "Success" },
@@ -7709,8 +7832,8 @@ var event = (store2, dynamicData2) => {
7709
7832
  setPage: async function() {
7710
7833
  const formdata = await this.getFormData();
7711
7834
  store2.setFormdata(formdata);
7712
- const schema = await this.getSchema();
7713
- store2.setSchema(schema);
7835
+ const schema2 = await this.getSchema();
7836
+ store2.setSchema(schema2);
7714
7837
  this.refreshPage(formdata.Handler, store2);
7715
7838
  },
7716
7839
  refreshPage: (handlerType, store22) => {
@@ -7793,7 +7916,7 @@ const executeEvents = async (config, componentName2, store2, dynamicData2, userV
7793
7916
  let nextEvent = [];
7794
7917
  let LoadResponse = null;
7795
7918
  if (config.eventType === "onLoad") {
7796
- const { response, events } = await executetOnLoadEvent(
7919
+ const { response: response2, events } = await executetOnLoadEvent(
7797
7920
  config,
7798
7921
  componentName2,
7799
7922
  store2,
@@ -7804,10 +7927,10 @@ const executeEvents = async (config, componentName2, store2, dynamicData2, userV
7804
7927
  eventGroups2,
7805
7928
  parentEventOutput2
7806
7929
  );
7807
- LoadResponse = response;
7930
+ LoadResponse = response2;
7808
7931
  nextEvent = events;
7809
7932
  } else {
7810
- const { response, events } = await executeEventsHandler(
7933
+ const { response: response2, events } = await executeEventsHandler(
7811
7934
  config,
7812
7935
  componentName2,
7813
7936
  store2,
@@ -7818,7 +7941,7 @@ const executeEvents = async (config, componentName2, store2, dynamicData2, userV
7818
7941
  eventGroups2,
7819
7942
  parentEventOutput2
7820
7943
  );
7821
- LoadResponse = response;
7944
+ LoadResponse = response2;
7822
7945
  nextEvent = events;
7823
7946
  }
7824
7947
  if ((nextEvent == null ? void 0 : nextEvent.length) > 0) {
@@ -7829,7 +7952,24 @@ const executeEvents = async (config, componentName2, store2, dynamicData2, userV
7829
7952
  };
7830
7953
  const executetOnLoadEvent = async (config, componentName2, store2, dynamicData2, userValue2, service2, serviceHolder2, eventGroups2, parentEventOutput2) => {
7831
7954
  try {
7832
- const { response } = await executeEventsHandler(
7955
+ const startEvent = config == null ? void 0 : config.events.filter((e) => e.eventType === "onStart");
7956
+ if (startEvent.length > 0) {
7957
+ const { response: response3 } = await executeEventsHandler(
7958
+ config,
7959
+ componentName2,
7960
+ store2,
7961
+ dynamicData2,
7962
+ userValue2,
7963
+ service2,
7964
+ serviceHolder2,
7965
+ eventGroups2,
7966
+ parentEventOutput2
7967
+ );
7968
+ if (response3) {
7969
+ return;
7970
+ }
7971
+ }
7972
+ const { response: response2 } = await executeEventsHandler(
7833
7973
  config,
7834
7974
  componentName2,
7835
7975
  store2,
@@ -7842,7 +7982,7 @@ const executetOnLoadEvent = async (config, componentName2, store2, dynamicData2,
7842
7982
  );
7843
7983
  const SuccessEvent = config == null ? void 0 : config.events.filter((e) => e.eventType === "Success");
7844
7984
  const setEvent = SuccessEvent.length > 0 ? SuccessEvent : [{ Handler: "mergeFormdata", eventType: "Success", type: config.type }];
7845
- return { response, events: setEvent };
7985
+ return { response: response2, events: setEvent };
7846
7986
  } catch (err) {
7847
7987
  const FailEvent = config == null ? void 0 : config.events.filter((e) => e.eventType === "Fail");
7848
7988
  const setEvent = FailEvent.length > 0 ? FailEvent : [];
@@ -7913,13 +8053,13 @@ async function executeApiEventHandler(apiHandlerConfig, componentName2, store2,
7913
8053
  "Access-Control-Allow-Origin": "*"
7914
8054
  };
7915
8055
  const { body: body2, headers: headers2 } = await buildApiPayload(apiHandlerConfig, initialBody, initialHeaders, store2, dynamicData2, userValue2);
7916
- let response;
7917
- response = await service2[apiHandlerConfig.method](
8056
+ let response2;
8057
+ response2 = await service2[apiHandlerConfig.method](
7918
8058
  apiHandlerConfig.path,
7919
8059
  body2,
7920
8060
  headers2 && { headers: headers2 }
7921
8061
  );
7922
- return { response, events: apiHandlerConfig == null ? void 0 : apiHandlerConfig.events };
8062
+ return { response: response2, events: apiHandlerConfig == null ? void 0 : apiHandlerConfig.events };
7923
8063
  }
7924
8064
  async function executeInBuiltFunctionHandler(refreshHandlerConfig, componentName, store, dynamicData, userValue, service, serviceHolder, parentEventOutput) {
7925
8065
  let parameter = {};
@@ -7931,9 +8071,10 @@ async function executeInBuiltFunctionHandler(refreshHandlerConfig, componentName
7931
8071
  return { response: void 0, events: refreshHandlerConfig == null ? void 0 : refreshHandlerConfig.events };
7932
8072
  }
7933
8073
  async function executeCustomHandler(customHandlerConfig, componentName, store, dynamicData, userValue, service, serviceHolder, parentEventOutput) {
8074
+ console.log(service);
7934
8075
  const makeFunc = eval(customHandlerConfig.eventCode);
7935
- makeFunc(store, dynamicData, userValue, parentEventOutput, service);
7936
- return { response: void 0, events: customHandlerConfig == null ? void 0 : customHandlerConfig.events };
8076
+ const response = await makeFunc(store, dynamicData, userValue, parentEventOutput, service, componentName);
8077
+ return { response, events: customHandlerConfig == null ? void 0 : customHandlerConfig.events };
7937
8078
  }
7938
8079
  async function mergeFormdata(handlerResponse, componentName2, eventConfig, store2) {
7939
8080
  if (eventConfig.type === "Select" && !(_.isEmpty(handlerResponse) && handlerResponse)) {
@@ -8012,6 +8153,7 @@ function getRefreshElements(eventConfig, eventGropus) {
8012
8153
  } else {
8013
8154
  if (eventGropus == null ? void 0 : eventGropus.onLoad) {
8014
8155
  result = Object.keys(eventGropus == null ? void 0 : eventGropus.onLoad);
8156
+ result.push(result[0]);
8015
8157
  }
8016
8158
  }
8017
8159
  return result;
@@ -8130,10 +8272,12 @@ var leaderBoard = {
8130
8272
  label: "LeaderBoard",
8131
8273
  divider: true
8132
8274
  },
8275
+ style: { wrapperStyle: {
8276
+ height: { xs: 850, sm: 1e3 }
8277
+ } },
8133
8278
  wrapperStyle: {
8134
8279
  position: "relative",
8135
- width: "100%",
8136
- height: 1e3
8280
+ width: "100%"
8137
8281
  }
8138
8282
  },
8139
8283
  elements: [
@@ -8649,6 +8793,41 @@ const PieGraph = {
8649
8793
  }
8650
8794
  }
8651
8795
  };
8796
+ const LineGraph = {
8797
+ type: "Control",
8798
+ scope: "#/properties/graph",
8799
+ options: {
8800
+ widget: "Graph"
8801
+ },
8802
+ config: {
8803
+ main: {
8804
+ type: "LineGraph",
8805
+ header: "Quartely Incentive in Thousand",
8806
+ bottomLabel: "Years",
8807
+ leftLabel: "Incentive",
8808
+ gridHidden: true,
8809
+ numHidden: false,
8810
+ tooltipDataKey: ["MAMA New Project", "Second", "Third"],
8811
+ axisLeft: true,
8812
+ axisBottom: true,
8813
+ hideLeftAxisLine: false,
8814
+ hideBottomAxisLine: false,
8815
+ legend: {
8816
+ labelColor: "green",
8817
+ legendTitle: "Our Assests",
8818
+ direction: "row",
8819
+ align: "right",
8820
+ colorRectWidth: 20
8821
+ }
8822
+ },
8823
+ style: {
8824
+ containerStyle: {},
8825
+ headerStyle: {},
8826
+ labelStyle: {},
8827
+ lineStyle: {}
8828
+ }
8829
+ }
8830
+ };
8652
8831
  const HorizontalBarGraph = {
8653
8832
  type: "Control",
8654
8833
  scope: "#/properties/graph",
@@ -8684,8 +8863,9 @@ const HorizontalBarGraph = {
8684
8863
  };
8685
8864
  const buildHorizontalBarGraph = (config, componentScope) => {
8686
8865
  const horizontalBarGraph = _.cloneDeep(HorizontalBarGraph);
8866
+ horizontalBarGraph.scope = componentScope;
8687
8867
  if (config.layout) {
8688
- horizontalBarGraph.config.layout = config.layout;
8868
+ horizontalBarGraph.config.layout = createLayoutFormat(config.layout);
8689
8869
  }
8690
8870
  horizontalBarGraph.scope = componentScope;
8691
8871
  horizontalBarGraph.config.main.header = config.heading;
@@ -8696,7 +8876,7 @@ const buildHorizontalBarGraph = (config, componentScope) => {
8696
8876
  horizontalBarGraph.config.containerStyle.background = config.containerBackground;
8697
8877
  }
8698
8878
  if (config.height) {
8699
- horizontalBarGraph.config.containerStyle.height = config.height;
8879
+ horizontalBarGraph.config.style.containerStyle.height = config.height;
8700
8880
  }
8701
8881
  if (config.bottomLabel) {
8702
8882
  horizontalBarGraph.config.main.bottomLabel = config.bottomLabel;
@@ -8713,10 +8893,12 @@ var SpeedoMeter = {
8713
8893
  widget: "SpeedoMeter"
8714
8894
  },
8715
8895
  config: {
8716
- layout: 12,
8896
+ layout: { xs: 0, sm: 12, md: 12, lg: 12 },
8897
+ width: 350,
8898
+ segments: "5",
8717
8899
  main: {
8718
- currentValueText: "",
8719
- customSegmentLabels: {},
8900
+ currentValueText: "Your Score",
8901
+ customSegmentLabels: [],
8720
8902
  data: {
8721
8903
  maxValue: 1e5,
8722
8904
  value: 5e4,
@@ -8730,7 +8912,6 @@ var SpeedoMeter = {
8730
8912
  needleColor: "#3f51b5",
8731
8913
  startColor: "red",
8732
8914
  textColor: "black",
8733
- segments: 5,
8734
8915
  endColor: "green",
8735
8916
  containerStyle: {
8736
8917
  background: "white",
@@ -8755,16 +8936,28 @@ const buildSpeedoMeter = (config, componentScope) => {
8755
8936
  const speedoMeter = _.cloneDeep(SpeedoMeter);
8756
8937
  speedoMeter.scope = componentScope;
8757
8938
  if (config.layout) {
8758
- speedoMeter.config.layout = config.layout;
8939
+ speedoMeter.config.layout = createLayoutFormat(config.layout);
8759
8940
  }
8760
8941
  if (config.heading) {
8761
8942
  speedoMeter.config.main.header = config.heading;
8762
8943
  }
8763
- if (config.currentValueText) {
8764
- speedoMeter.config.main.currentValueText = config.currentValueText;
8944
+ if (config.segments) {
8945
+ speedoMeter.config.main.segments = config.segments;
8946
+ }
8947
+ if (config.style) {
8948
+ const styleObj = JSON.parse(config.style);
8949
+ if (styleObj == null ? void 0 : styleObj.style) {
8950
+ speedoMeter.config.style = { ...speedoMeter.config.style, ...styleObj.style };
8951
+ }
8952
+ if (styleObj == null ? void 0 : styleObj.containerStyle) {
8953
+ speedoMeter.config.style.containerStyle = { ...speedoMeter.config.style.containerStyle, ...styleObj.containerStyle };
8954
+ }
8955
+ }
8956
+ if (config.width) {
8957
+ speedoMeter.config.main.width = config.width;
8765
8958
  }
8766
- if (config.customSegmentLabels) {
8767
- speedoMeter.config.main.customSegmentLabels = config.customSegmentLabels;
8959
+ if (config.speedoCaption) {
8960
+ speedoMeter.config.main.currentValueText = config.speedoCaption;
8768
8961
  }
8769
8962
  if (config.data) {
8770
8963
  speedoMeter.config.main.data = config.data;
@@ -8789,34 +8982,28 @@ const buildSpeedoMeter = (config, componentScope) => {
8789
8982
  const buildPieGraph = (config, componentScope) => {
8790
8983
  const pieGraph = _.cloneDeep(PieGraph);
8791
8984
  if (config.layout) {
8792
- pieGraph.config.layout = config.layout;
8793
- }
8794
- if (config.containerBackground) {
8795
- pieGraph.config.style.containerStyle.background = config.containerBackground;
8985
+ pieGraph.config.layout = createLayoutFormat(config.layout);
8796
8986
  }
8797
8987
  if (config.height) {
8798
8988
  pieGraph.config.style.containerStyle.height = config.height;
8799
8989
  }
8800
- if (config.legendAvailabe) {
8801
- pieGraph.config.main.legendAvailabe = config.legendAvailabe === "YES" ? false : true;
8990
+ if (config.legendHide) {
8991
+ pieGraph.config.main.legendAvailabe = config.legendHide === "YES" ? false : true;
8802
8992
  }
8803
8993
  pieGraph.scope = componentScope;
8804
8994
  pieGraph.config.main.header = config.heading;
8805
- if (config.bottomLabel) {
8806
- pieGraph.config.main.bottomLabel = config.bottomLabel;
8995
+ if (config.legendLabels) {
8996
+ pieGraph.config.main.tooltipDataKey = flatObjectValueInArray(config.legendLabels);
8807
8997
  }
8808
- if (config.leftLabel) {
8809
- pieGraph.config.main.leftLabel = config.leftLabel;
8810
- }
8811
- if (config.tooltipDataKey) {
8812
- pieGraph.config.main.tooltipDataKey = config.tooltipDataKey;
8998
+ if (config.pieArcColors) {
8999
+ pieGraph.config.style.pieStyle.colorRange = flatObjectValueInArray(config.pieArcColors);
8813
9000
  }
8814
9001
  return pieGraph;
8815
9002
  };
8816
9003
  const buildStackbarGraph = (config, componentScope) => {
8817
9004
  const barGraph = _.cloneDeep(BarGraph);
8818
9005
  if (config.layout) {
8819
- barGraph.config.layout = config.layout;
9006
+ barGraph.config.layout = createLayoutFormat(config.layout);
8820
9007
  }
8821
9008
  if (config.legendHide) {
8822
9009
  barGraph.config.main.legendAvailable = false;
@@ -9249,15 +9436,12 @@ const buildCard = (config, componentScope) => {
9249
9436
  if (config.style) {
9250
9437
  card.config.style = JSON.parse(config.style);
9251
9438
  }
9252
- card.elements[0].scope = `#/properties/${config.name.replace(/ /g, "")}/value`;
9253
- card.elements[1].scope = `#/properties/${config.name.replace(/ /g, "")}/url`;
9254
- card.elements[2].scope = `#/properties/${config.name.replace(/ /g, "")}/description`;
9439
+ card.elements[0].scope = `#/properties/${config.name}/properties/value`;
9440
+ card.elements[1].scope = `#/properties/${config.name}/properties/url`;
9441
+ card.elements[2].scope = `#/properties/${config.name}/properties/description`;
9255
9442
  if (config.layout) {
9256
9443
  card.config.layout = createLayoutFormat(config.layout);
9257
9444
  }
9258
- card.elements[0].config.main.heading = config.label;
9259
- card.elements[1].config.main.url = config.url;
9260
- card.elements[2].config.main.heading = config.description;
9261
9445
  return card;
9262
9446
  };
9263
9447
  var DateInputField = {
@@ -9378,7 +9562,7 @@ const buildTimer = (config, componentScope) => {
9378
9562
  timer.config.main.label = config.label;
9379
9563
  }
9380
9564
  if (config.layout) {
9381
- timer.config.layout = config.layout;
9565
+ timer.config.layout = createLayoutFormat(config.layout);
9382
9566
  }
9383
9567
  return timer;
9384
9568
  };
@@ -9466,7 +9650,7 @@ var cardSlider = {
9466
9650
  },
9467
9651
  elements: [],
9468
9652
  config: {
9469
- layout: { xs: 11, sm: 11, md: 5.5, lg: 5.5 },
9653
+ layout: 12,
9470
9654
  main: {}
9471
9655
  }
9472
9656
  };
@@ -9505,6 +9689,63 @@ const buildCheckbox = (config, componentScope) => {
9505
9689
  }
9506
9690
  return check;
9507
9691
  };
9692
+ const buildLineGraph = (config, componentScope) => {
9693
+ const lineGraph = _.cloneDeep(LineGraph);
9694
+ if (config.layout) {
9695
+ lineGraph.config.layout = config.layout;
9696
+ }
9697
+ lineGraph.config.main.header = config.heading;
9698
+ if (config.height) {
9699
+ lineGraph.config.style.containerStyle.height = config.height;
9700
+ }
9701
+ if (config.bottomLabel) {
9702
+ lineGraph.config.main.bottomLabel = config.bottomLabel;
9703
+ }
9704
+ if (config.leftLabel) {
9705
+ lineGraph.config.main.leftLabel = config.leftLabel;
9706
+ }
9707
+ if (config.legendHide) {
9708
+ lineGraph.config.main.legendAvailabe = config.legendHide === "YES" ? false : true;
9709
+ }
9710
+ if (config.legendLabels) {
9711
+ lineGraph.config.main.tooltipDataKey = flatObjectValueInArray(config.legendLabels);
9712
+ }
9713
+ if (config.pieArcColors) {
9714
+ lineGraph.config.style.lineStyle.colorRange = flatObjectValueInArray(config.pieArcColors);
9715
+ }
9716
+ lineGraph.scope = componentScope;
9717
+ return lineGraph;
9718
+ };
9719
+ const RadioUiSchema = {
9720
+ type: "Control",
9721
+ scope: "#/properties/invoiceEnabled",
9722
+ options: {
9723
+ widget: "RadioInputField"
9724
+ },
9725
+ config: {
9726
+ layout: { xs: 11, sm: 11, md: 5.5, lg: 5.5 },
9727
+ main: {
9728
+ label: "Enabled",
9729
+ options: ["YES", "NO"],
9730
+ errorMessage: "Enabled is not marked as YES or NO"
9731
+ }
9732
+ }
9733
+ };
9734
+ const buildRadio = (config, componentScope) => {
9735
+ const Radio = _.cloneDeep(RadioUiSchema);
9736
+ Radio.scope = componentScope;
9737
+ Radio.config.main.heading = config.label;
9738
+ if (config.layout) {
9739
+ Radio.config.layout = createLayoutFormat(config.layout);
9740
+ }
9741
+ if (config.sectionLabels) {
9742
+ Radio.config.main.options = config.sectionLabels.map((e) => e.label || e.Options);
9743
+ }
9744
+ if (config.style) {
9745
+ Radio.config.style = JSON.parse(config.style);
9746
+ }
9747
+ return Radio;
9748
+ };
9508
9749
  const buildUiSchema = (config) => {
9509
9750
  let elements = {};
9510
9751
  const componentScope = `#/properties/${config.name}`;
@@ -9530,6 +9771,9 @@ const buildUiSchema = (config) => {
9530
9771
  case "Select":
9531
9772
  elements = buildSelect(config, componentScope);
9532
9773
  break;
9774
+ case "Radio":
9775
+ elements = buildRadio(config, componentScope);
9776
+ break;
9533
9777
  case "Button":
9534
9778
  elements = buildButton(config, componentScope);
9535
9779
  break;
@@ -9565,7 +9809,7 @@ const buildUiSchema = (config) => {
9565
9809
  elements = buildStackbarGraph(config, componentScope);
9566
9810
  break;
9567
9811
  case "LineGraph":
9568
- elements = buildPieGraph(config, componentScope);
9812
+ elements = buildLineGraph(config, componentScope);
9569
9813
  break;
9570
9814
  case "PieGraph":
9571
9815
  elements = buildPieGraph(config, componentScope);
@@ -9630,8 +9874,37 @@ const buildUiSchema = (config) => {
9630
9874
  }
9631
9875
  return elements;
9632
9876
  };
9877
+ const schema = {
9878
+ type: "object",
9879
+ properties: {},
9880
+ required: []
9881
+ };
9882
+ const buildSchema = (config) => {
9883
+ function buildRule(configObj) {
9884
+ if (configObj.validation) {
9885
+ configObj.validation.forEach((rule) => {
9886
+ if (!schema.properties[configObj.name]) {
9887
+ schema.properties[configObj.name] = {};
9888
+ }
9889
+ if (rule.validationType === "required") {
9890
+ schema.required.push(configObj.name);
9891
+ } else {
9892
+ schema.properties[configObj.name]["type"] = "string";
9893
+ schema.properties[configObj.name][rule.validationType] = isNaN(rule.validationValue) ? rule.validationValue : Number(rule.validationValue);
9894
+ }
9895
+ });
9896
+ }
9897
+ }
9898
+ buildRule(config);
9899
+ if (config == null ? void 0 : config.elements) {
9900
+ config.elements.forEach(buildRule);
9901
+ }
9902
+ console.log(schema);
9903
+ window.localStorage.setItem("schemaDemo", JSON.stringify(schema));
9904
+ return schema;
9905
+ };
9633
9906
  var clearLocalStorage = () => {
9634
9907
  localStorage.removeItem("pageFormdata");
9635
9908
  };
9636
- export { buildConfig, buildUiSchema, clearLocalStorage as clearPreviousCache, pageMaster, Component as pageMasterComponents, event as pageMasterEvents, service as pageService };
9909
+ export { buildConfig, buildSchema, buildUiSchema, clearLocalStorage as clearPreviousCache, pageMaster, Component as pageMasterComponents, event as pageMasterEvents, service as pageService };
9637
9910
  //# sourceMappingURL=impaktapps-ui-builder.es.js.map