impaktapps-ui-builder 1.0.621 → 1.0.622

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 (100) hide show
  1. package/dist/impaktapps-ui-builder.es.js +2002 -897
  2. package/dist/impaktapps-ui-builder.es.js.map +1 -1
  3. package/dist/impaktapps-ui-builder.umd.js +15 -15
  4. package/dist/impaktapps-ui-builder.umd.js.map +1 -1
  5. package/dist/src/impaktapps-ui-builder/builder/build/buildAreaGraph.d.ts +2 -0
  6. package/dist/src/impaktapps-ui-builder/builder/build/buildCamera.d.ts +1 -0
  7. package/dist/src/impaktapps-ui-builder/builder/build/buildConfig.d.ts +1 -0
  8. package/dist/src/impaktapps-ui-builder/builder/build/buildGroupButton.d.ts +1 -0
  9. package/dist/src/impaktapps-ui-builder/builder/build/buildHierarchyChart.d.ts +1 -0
  10. package/dist/src/impaktapps-ui-builder/builder/build/buildHorizontalLayout.d.ts +1 -0
  11. package/dist/src/impaktapps-ui-builder/builder/build/buildImage.d.ts +1 -0
  12. package/dist/src/impaktapps-ui-builder/builder/build/buildMetricCard.d.ts +1 -0
  13. package/dist/src/impaktapps-ui-builder/builder/build/buildOTP_inputs.d.ts +1 -0
  14. package/dist/src/impaktapps-ui-builder/builder/build/buildPdfViewer.d.ts +1 -0
  15. package/dist/src/impaktapps-ui-builder/builder/build/buildPopover.d.ts +1 -0
  16. package/dist/src/impaktapps-ui-builder/builder/build/buildStackBarLineGraph.d.ts +2 -0
  17. package/dist/src/impaktapps-ui-builder/builder/build/buildUiSchema.d.ts +2 -1
  18. package/dist/src/impaktapps-ui-builder/builder/build/uischema/box.d.ts +4 -1
  19. package/dist/src/impaktapps-ui-builder/builder/build/uischema/buildPropertiesSection.d.ts +1 -1
  20. package/dist/src/impaktapps-ui-builder/builder/build/uischema/buttonGroup.d.ts +22 -0
  21. package/dist/src/impaktapps-ui-builder/builder/build/uischema/card.d.ts +173 -171
  22. package/dist/src/impaktapps-ui-builder/builder/build/uischema/eventSection.d.ts +18 -50
  23. package/dist/src/impaktapps-ui-builder/builder/build/uischema/graph.d.ts +50 -4
  24. package/dist/src/impaktapps-ui-builder/builder/build/uischema/hierarchyChart.d.ts +22 -0
  25. package/dist/src/impaktapps-ui-builder/builder/build/uischema/horizontalLayout.d.ts +13 -0
  26. package/dist/src/impaktapps-ui-builder/builder/build/uischema/metricCard.d.ts +17 -0
  27. package/dist/src/impaktapps-ui-builder/builder/build/uischema/multiSelect.d.ts +1 -0
  28. package/dist/src/impaktapps-ui-builder/builder/build/uischema/pdfViewer.d.ts +19 -0
  29. package/dist/src/impaktapps-ui-builder/builder/build/uischema/selectInputField.d.ts +1 -0
  30. package/dist/src/impaktapps-ui-builder/builder/build/uischema/tableSection.d.ts +15 -66
  31. package/dist/src/impaktapps-ui-builder/builder/build/uischema/wrapperSection.d.ts +3 -1
  32. package/dist/src/impaktapps-ui-builder/builder/services/utils.d.ts +2 -1
  33. package/dist/src/impaktapps-ui-builder/lib/index.d.ts +1 -0
  34. package/dist/src/impaktapps-ui-builder/runtime/services/downloadFile.d.ts +5 -2
  35. package/dist/src/impaktapps-ui-builder/runtime/services/service.d.ts +8 -4
  36. package/package.json +1 -1
  37. package/src/impaktapps-ui-builder/builder/build/buildAreaGraph.ts +66 -0
  38. package/src/impaktapps-ui-builder/builder/build/buildArray.ts +13 -0
  39. package/src/impaktapps-ui-builder/builder/build/buildCamera.ts +50 -0
  40. package/src/impaktapps-ui-builder/builder/build/buildCard.ts +10 -10
  41. package/src/impaktapps-ui-builder/builder/build/buildConfig.ts +23 -9
  42. package/src/impaktapps-ui-builder/builder/build/buildDate.ts +35 -13
  43. package/src/impaktapps-ui-builder/builder/build/buildDownloadFile.ts +7 -0
  44. package/src/impaktapps-ui-builder/builder/build/buildEmptyBox.ts +4 -0
  45. package/src/impaktapps-ui-builder/builder/build/buildFileInput.ts +42 -28
  46. package/src/impaktapps-ui-builder/builder/build/buildGroupButton.ts +24 -0
  47. package/src/impaktapps-ui-builder/builder/build/buildHierarchyChart.ts +35 -0
  48. package/src/impaktapps-ui-builder/builder/build/buildHorizontalBarGraph.ts +9 -3
  49. package/src/impaktapps-ui-builder/builder/build/buildHorizontalLayout.ts +15 -0
  50. package/src/impaktapps-ui-builder/builder/build/buildImage.ts +38 -0
  51. package/src/impaktapps-ui-builder/builder/build/buildLabel.ts +3 -0
  52. package/src/impaktapps-ui-builder/builder/build/buildLeaderboard.ts +3 -0
  53. package/src/impaktapps-ui-builder/builder/build/buildLineGraph.ts +9 -3
  54. package/src/impaktapps-ui-builder/builder/build/buildMetricCard.tsx +37 -0
  55. package/src/impaktapps-ui-builder/builder/build/buildMultiSelect.ts +9 -0
  56. package/src/impaktapps-ui-builder/builder/build/buildOTP_inputs.ts +44 -0
  57. package/src/impaktapps-ui-builder/builder/build/buildPdfViewer.ts +16 -0
  58. package/src/impaktapps-ui-builder/builder/build/buildPieGraph.ts +6 -3
  59. package/src/impaktapps-ui-builder/builder/build/buildPop.ts +1 -0
  60. package/src/impaktapps-ui-builder/builder/build/buildPopover.ts +40 -0
  61. package/src/impaktapps-ui-builder/builder/build/buildProgressBar.ts +31 -21
  62. package/src/impaktapps-ui-builder/builder/build/buildRadio.ts +10 -2
  63. package/src/impaktapps-ui-builder/builder/build/buildSelect.ts +9 -0
  64. package/src/impaktapps-ui-builder/builder/build/buildStackBarGraph.ts +9 -3
  65. package/src/impaktapps-ui-builder/builder/build/buildStackBarLineGraph.ts +72 -0
  66. package/src/impaktapps-ui-builder/builder/build/buildTabSection.ts +5 -0
  67. package/src/impaktapps-ui-builder/builder/build/buildTable.ts +21 -11
  68. package/src/impaktapps-ui-builder/builder/build/buildText.ts +9 -0
  69. package/src/impaktapps-ui-builder/builder/build/buildUiSchema.ts +144 -124
  70. package/src/impaktapps-ui-builder/builder/build/buildUplaodFile.ts +6 -0
  71. package/src/impaktapps-ui-builder/builder/build/buildWrapperSection.ts +7 -2
  72. package/src/impaktapps-ui-builder/builder/build/uischema/box.ts +4 -1
  73. package/src/impaktapps-ui-builder/builder/build/uischema/buildPropertiesSection.ts +315 -21
  74. package/src/impaktapps-ui-builder/builder/build/uischema/buttonGroup.ts +17 -0
  75. package/src/impaktapps-ui-builder/builder/build/uischema/card.ts +142 -169
  76. package/src/impaktapps-ui-builder/builder/build/uischema/coreSection.ts +74 -19
  77. package/src/impaktapps-ui-builder/builder/build/uischema/eventSection.ts +30 -54
  78. package/src/impaktapps-ui-builder/builder/build/uischema/file.ts +1 -1
  79. package/src/impaktapps-ui-builder/builder/build/uischema/graph.ts +37 -4
  80. package/src/impaktapps-ui-builder/builder/build/uischema/hierarchyChart.ts +13 -0
  81. package/src/impaktapps-ui-builder/builder/build/uischema/horizontalLayout.ts +11 -0
  82. package/src/impaktapps-ui-builder/builder/build/uischema/metricCard.ts +13 -0
  83. package/src/impaktapps-ui-builder/builder/build/uischema/multiSelect.ts +2 -0
  84. package/src/impaktapps-ui-builder/builder/build/uischema/pdfViewer.ts +18 -0
  85. package/src/impaktapps-ui-builder/builder/build/uischema/selectInputField.ts +2 -0
  86. package/src/impaktapps-ui-builder/builder/build/uischema/tableSection.ts +34 -60
  87. package/src/impaktapps-ui-builder/builder/build/uischema/wrapperSection.ts +3 -1
  88. package/src/impaktapps-ui-builder/builder/elements/UiSchema/Component/schema.ts +219 -75
  89. package/src/impaktapps-ui-builder/builder/elements/UiSchema/Component/uiSchema.ts +61 -1
  90. package/src/impaktapps-ui-builder/builder/elements/UiSchema/PageMaster/uiSchema.ts +94 -106
  91. package/src/impaktapps-ui-builder/builder/elements/UiSchema/event/schema.ts +4 -3
  92. package/src/impaktapps-ui-builder/builder/elements/UiSchema/event/uiSchema.ts +31 -55
  93. package/src/impaktapps-ui-builder/builder/services/component.ts +174 -86
  94. package/src/impaktapps-ui-builder/builder/services/event.ts +3 -0
  95. package/src/impaktapps-ui-builder/builder/services/pageMaster.ts +18 -15
  96. package/src/impaktapps-ui-builder/builder/services/utils.ts +15 -3
  97. package/src/impaktapps-ui-builder/lib/index.ts +10 -9
  98. package/src/impaktapps-ui-builder/runtime/services/downloadFile.ts +42 -22
  99. package/src/impaktapps-ui-builder/runtime/services/events.ts +9 -11
  100. package/src/impaktapps-ui-builder/runtime/services/service.ts +118 -158
@@ -0,0 +1,72 @@
1
+ import { createLayoutFormat, createKeyValueMap } from "./buildConfig";
2
+ import { StackBarLineG } from "./uischema/graph";
3
+ import _ from "lodash";
4
+
5
+
6
+ const buildStackBarLineGraph = (config:any,componentScope:string) => {
7
+ const StackBarLineGraph: any = _.cloneDeep(StackBarLineG);
8
+ StackBarLineGraph.scope = componentScope;
9
+ if (config.layout) {
10
+ StackBarLineGraph.config.layout = createLayoutFormat(config.layout, config.type);
11
+ }
12
+ StackBarLineGraph.config.main.type = config.graphType;
13
+ StackBarLineGraph.scope = componentScope;
14
+ StackBarLineGraph.config.main.header = config.heading;
15
+ StackBarLineGraph.config.main.subHeader = config.subHeader;
16
+ if (config.legendHide) {
17
+ StackBarLineGraph.config.main.legendAvailable = config.legendHide==="YES"?false:true;
18
+ }
19
+ if (config.bottomAxisAngle) {
20
+ StackBarLineGraph.config.main.bottomAxisAngle = config.bottomAxisAngle==="YES"?true:false;
21
+ }
22
+ if (config.legendLabels) {
23
+ StackBarLineGraph.config.main.legendLabels = createKeyValueMap(config.legendLabels);
24
+ }
25
+ if(config.legendDirection){
26
+ StackBarLineGraph.config.main.legendDirection = config.legendDirection === "Row" ? "row" : "column";
27
+ }
28
+ if (config.height) {
29
+ StackBarLineGraph.config.style.containerStyle.height = config.height;
30
+ }
31
+ if (config.pieArcColors) {
32
+ StackBarLineGraph.config.style.colorMap = createKeyValueMap(config.pieArcColors);
33
+ }
34
+ if(config.yAxisTickCount){
35
+ StackBarLineGraph.config.main.yAxisTickCount = config.yAxisTickCount
36
+ }
37
+ if(config.xAxisTickCount){
38
+ StackBarLineGraph.config.main.xAxisTickCount = config.xAxisTickCount
39
+ }
40
+ if (config.xAxisValue) {
41
+ StackBarLineGraph.config.main.xAxisValue = config.xAxisValue;
42
+ }
43
+ if(config.xAxisType) {
44
+ StackBarLineGraph.config.main.xAxisType = config.xAxisType;
45
+ }
46
+ if (config.bottomLabel) {
47
+ StackBarLineGraph.config.main.bottomLabel = config.bottomLabel;
48
+ }
49
+ if (config.leftLabel) {
50
+ StackBarLineGraph.config.main.leftLabel = config.leftLabel;
51
+ }
52
+ if (config.rightLabel) {
53
+ StackBarLineGraph.config.main.rightLabel = config.rightLabel;
54
+ }
55
+ if (config.disableLeftLabel) {
56
+ StackBarLineGraph.config.main.disableLeftLabel = config.disableLeftLabel==="YES"? true: false;
57
+ }
58
+ if (config.growthRateKey) {
59
+ StackBarLineGraph.config.main.growthRateKey = config.growthRateKey;
60
+ }
61
+ if (config.tooltipUnit) {
62
+ StackBarLineGraph.config.main.tooltipUnit = config.tooltipUnit;
63
+ }
64
+ if (config.leftMargin) {
65
+ StackBarLineGraph.config.style.labelStyle.margin ={
66
+ left: config.leftMargin
67
+ }
68
+ }
69
+ return StackBarLineGraph
70
+ }
71
+
72
+ export default buildStackBarLineGraph;
@@ -1,3 +1,4 @@
1
+ import { flatObjectValueInArray } from "./buildConfig";
1
2
  import Tabsection from "./uischema/tabsection";
2
3
  import _ from "lodash";
3
4
 
@@ -13,6 +14,10 @@ export const buildTabSection = (config:any,componentScope:string) => {
13
14
  }
14
15
  if (config.sectionLabels) {
15
16
  tab.config.main.tabLabels = config.sectionLabels.map(e => e.label);
17
+ tab.config.main.tabIcons = config.sectionLabels.map(e => e.icon);
18
+ }
19
+ if (config.style) {
20
+ tab.config.style = JSON.parse(config.style)
16
21
  }
17
22
  tab.config.main.id = config.name;
18
23
  return tab
@@ -1,3 +1,4 @@
1
+ import { createLayoutFormat } from "./buildConfig";
1
2
  import Table from "./uischema/table";
2
3
  import _ from "lodash";
3
4
 
@@ -10,6 +11,9 @@ export const buildTable = (config: any, componentScope: string) => {
10
11
  if (config.lazyLoading) {
11
12
  table.config.main.lazyLoading = config.lazyLoading === "YES" ? true : false;
12
13
  }
14
+ if (config.defaultColumnSize) {
15
+ table.config.main.defaultColumnSize = config.defaultColumnSize
16
+ }
13
17
  if (config.enableRowMovement) {
14
18
  table.config.main.enableRowMovement = config.enableRowMovement === "YES" ? true : false;
15
19
  }
@@ -26,9 +30,6 @@ export const buildTable = (config: any, componentScope: string) => {
26
30
  if (config.paginateExpandedRows) {
27
31
  table.config.main.paginateExpandedRows = config.paginateExpandedRows === "YES" ? true : false;
28
32
  }
29
- if (config.treeStructure) {
30
- table.config.main.treeStructure = config.treeStructure === "YES" ? "flatTreeMap" : false;
31
- }
32
33
  if (config.SelectionAvailable) {
33
34
  table.config.main.Selection = config.SelectionAvailable === "YES" ? true : false
34
35
  };
@@ -41,28 +42,28 @@ export const buildTable = (config: any, componentScope: string) => {
41
42
  if (config.downloadAllData) {
42
43
  table.config.main.downloadAllData = config.downloadAllData === "YES" ? true : false
43
44
  }
44
- if(config.disableGlobalSearch){
45
+ if (config.disableGlobalSearch) {
45
46
  table.config.main.disableGlobalSearch = config.disableGlobalSearch === "YES" ? true : false
46
47
  }
47
- if(config.disableColumnFilter){
48
+ if (config.disableColumnFilter) {
48
49
  table.config.main.disableColumnFilter = config.disableColumnFilter === "YES" ? true : false
49
50
  }
50
- if(config.disableSorting){
51
+ if (config.disableSorting) {
51
52
  table.config.main.disableSorting = config.disableSorting === "YES" ? true : false
52
53
  }
53
- if(config.disableEditColumn){
54
+ if (config.disableEditColumn) {
54
55
  table.config.main.disableEditColumn = config.disableEditColumn === "YES" ? true : false
55
56
  }
56
- if(config.disableFullScreenToggle){
57
+ if (config.disableFullScreenToggle) {
57
58
  table.config.main.disableFullScreenToggle = config.disableFullScreenToggle === "YES" ? true : false
58
59
  }
59
- if(config.disableDensityToggle){
60
+ if (config.disableDensityToggle) {
60
61
  table.config.main.disableDensityToggle = config.disableDensityToggle === "YES" ? true : false
61
62
  }
62
- if(config.disableDownloadFile){
63
+ if (config.disableDownloadFile) {
63
64
  table.config.main.disableDownloadFile = config.disableDownloadFile === "YES" ? true : false
64
65
  }
65
- if(config.disablePagination){
66
+ if (config.disablePagination) {
66
67
  table.config.main.disablePagination = config.disablePagination === "YES" ? true : false
67
68
  }
68
69
  if (config.Table_Download_Keys_Name) {
@@ -71,5 +72,14 @@ export const buildTable = (config: any, componentScope: string) => {
71
72
  if (config.selectKey) {
72
73
  table.config.main.selectKey = config.selectKey
73
74
  }
75
+ if (config.maxPageSize) {
76
+ table.config.main.maxPageSize = config.maxPageSize
77
+ }
78
+ if(config.initialDensity){
79
+ table.config.main.initialDensity = config.initialDensity
80
+ }
81
+ if(config.layout){
82
+ table.config.layout = createLayoutFormat(config.layout)
83
+ }
74
84
  return table;
75
85
  };
@@ -26,6 +26,15 @@ export const buildTextField = (config: any, componentScope: string) => {
26
26
  if (config.layout) {
27
27
  inputField.config.layout = createLayoutFormat(config.layout)
28
28
  }
29
+ if (config.toolTip) {
30
+ inputField.config.main.toolTip = config.toolTip;
31
+ }
32
+ if (config.toolTipPosition) {
33
+ inputField.config.main.toolTipPosition = config.toolTipPosition;
34
+ }
35
+ if(config.iconName){
36
+ inputField.config.main.startIcon = config.iconName;
37
+ }
29
38
  inputField.config.main.errorMessage = `${config.name} is empty or invalid`;
30
39
  inputField.scope = componentScope;
31
40
  return inputField;
@@ -1,6 +1,4 @@
1
1
  import _ from "lodash";
2
- import emptyBox from "./uischema/emptyBox";
3
- import cardSlider from "./uischema/cardSlider";
4
2
  import { buildLeaderBoard } from "./buildLeaderboard";
5
3
  import { buildProgressBarCard } from "./buildProgressBarCard";
6
4
  import { buildProgressBar } from "./buildProgressBar";
@@ -19,6 +17,7 @@ import { buildLabel } from "./buildLabel";
19
17
  import { buildUploadFile } from "./buildUplaodFile";
20
18
  import { buildDownloadFile } from "./buildDownloadFile";
21
19
  import { buildCard } from "./buildCard";
20
+ import { buildMetricCard } from "./buildMetricCard";
22
21
  import { buildDate, buildDateTime } from "./buildDate";
23
22
  import { buildRankCard } from "./buildRankCard";
24
23
  import { buildRollAndDice } from "./buildRollAndDice";
@@ -40,136 +39,99 @@ import { buildDataGrid } from "./buildDataGrid";
40
39
  import { buildInputSlider } from "./buildInputSlider";
41
40
  import { buildTreeMap } from "./buildTreeMap";
42
41
  import { buildThoughtOfTheDay } from "./buildThoughtOfTheDay";
42
+ import { buildHorizontalLayout } from "./buildHorizontalLayout";
43
+ import { buildImage } from "./buildImage";
44
+ import buildAreaGraph from "./buildAreaGraph";
45
+ import buildStackBarLineGraph from "./buildStackBarLineGraph";
46
+ import { buildCamera } from "./buildCamera";
47
+ import { buildButtonGroup } from "./buildGroupButton";
48
+ import { buildPopOver } from "./buildPopover";
49
+ import { buildOTP_Input } from "./buildOTP_inputs";
50
+ import { buildPdfViewer } from "./buildPdfViewer";
51
+ import { buildHierarchyChart } from "./buildHierarchyChart";
43
52
  export let schema = {
44
53
  type: "object",
45
54
  properties: {},
46
55
  required: []
47
56
  };
48
- //MultipleSelect
49
- function buildRule(configObj: any, tableName?: string, arrayHolderName?: boolean) {
50
- if (arrayHolderName) {
51
- if (schema.properties?.[tableName]?.items?.properties) {
52
- if (!schema.properties?.[tableName]?.items?.properties?.[configObj.name]) {
53
- schema.properties[tableName].items.properties[configObj.name] = {};
54
- if (configObj.type === "Select" && configObj.value?.length > 0) {
55
- schema.properties[tableName].items.properties[configObj.name] = {
56
- oneOf: configObj.value.map((e) => {
57
- return { const: e.value, title: e.label }
58
- })
59
- }
60
- }
61
- else if (configObj.type === "MultipleSelect" && configObj.value?.length > 0) {
62
- schema.properties[tableName].items.properties[configObj.name] = {
63
- items: {
64
- oneOf: configObj.value.map((e) => {
65
- return { const: e.value, title: e.label }
66
- })
67
- }
68
- }
69
- }
70
- }
71
- }
72
- } else if ((configObj.type === "Select" || configObj.type === "MultipleSelect") && configObj.value?.length > 0) {
73
- if (configObj.type === "Select") {
74
- schema.properties[configObj.name] = {
75
- oneOf: configObj.value.map((e) => {
76
- return { const: e.value, title: e.label }
77
- })
78
- }
79
- }
80
- else if (configObj.type === "MultipleSelect") {
81
- schema.properties[configObj.name] = {
57
+ function buildOneOf(values: any[]) {
58
+ return values.map((e) => ({
59
+ const: e.value,
60
+ title: e.label
61
+ }));
62
+ }
63
+ export function buildSchemaFromConfig(config: any, parentSchema: any) {
64
+ if (config.elements) {
65
+ if (config.type === "Array") {
66
+ parentSchema.properties ??= {};
67
+ parentSchema.properties[config.name] ??= {
68
+ type: "array",
82
69
  items: {
83
- oneOf: configObj.value.map((e) => {
84
- return { const: e.value, title: e.label }
85
- })
86
- }
87
- }
88
- }
89
- }
90
- if (configObj.validation) {
91
- configObj.validation.forEach((rule: any) => {
92
- if (tableName) {
93
- if (schema.properties?.[tableName]?.items?.properties) {
94
- if (!schema.properties?.[tableName]?.items?.properties?.[configObj.name]) {
95
- schema.properties[tableName].items.properties[configObj.name] = {};
96
- if (configObj.type === "Select" || configObj.value?.length > 0) {
97
- schema.properties[tableName].items.properties[configObj.name] = {
98
- oneOf: configObj.value.map((e) => {
99
- return { const: e.value, title: e.label }
100
- })
101
- }
102
- }
103
- else if (configObj.type === "MultipleSelect" || configObj.value?.length > 0) {
104
- schema.properties[tableName].items.properties[configObj.name] = {
105
- items: {
106
- oneOf: configObj.value.map((e) => {
107
- return { const: e.value, title: e.label }
108
- })
109
- }
110
- }
111
- }
112
- }
113
- if (rule.validationType === "required") {
114
- schema.properties?.[tableName]?.items?.required.push(configObj.name)
115
- } else {
116
- schema.properties[tableName].items.properties[configObj.name]["type"] = "string"
117
- schema.properties[tableName].items.properties[configObj.name][rule.validationType] =
118
- isNaN(rule.validationValue) ?
119
- rule.validationValue : Number(rule.validationValue)
120
- }
121
-
122
- }
123
- } else {
124
- if (!schema.properties[configObj.name]) {
125
- schema.properties[configObj.name] = {};
126
- }
127
- if (rule.validationType === "required") {
128
- schema.required.push(configObj.name)
129
- } else {
130
- schema.properties[configObj.name]["type"] = "string"
131
- schema.properties[configObj.name][rule.validationType] =
132
- isNaN(rule.validationValue) ?
133
- rule.validationValue : Number(rule.validationValue)
134
- }
135
- }
136
- });
137
- }
70
+ type: "object",
71
+ properties: {},
72
+ required: [],
73
+ },
74
+ };
138
75
 
76
+ const arrayItemSchema = parentSchema.properties[config.name].items;
139
77
 
140
- }
141
- export const buildSchema = (config: any, tableName?: string, isArrayType?: boolean) => {
142
- buildRule(config, tableName, isArrayType);
143
- if (config?.elements) {
144
- if ( config.type == "Array") {
145
- if (!schema.properties[config.name]) {
146
- schema.properties[config.name] = {
147
- type: "array",
148
- items: {
149
- type: "object",
150
- properties: {},
151
- required: []
152
- }
153
- }
154
- }
155
- config.elements.map((e, elemInd) => {
156
- buildSchema(e, config.name, config.type === "Array" ? true : false)
157
- })
78
+ config.elements?.forEach((child: any) =>
79
+ buildSchemaFromConfig(child, arrayItemSchema)
80
+ );
81
+ return;
82
+ } else {
83
+ config.elements?.forEach((child: any) =>
84
+ buildSchemaFromConfig(child, parentSchema)
85
+ );
86
+ return;
158
87
  }
159
- else {
160
- config.elements.map((e, elemInd) => {
161
- buildSchema(e)
162
- })
88
+ }
89
+ parentSchema.properties ??= {};
90
+ parentSchema.properties[config.name] ??= {};
91
+ const fieldSchema = parentSchema.properties[config.name];
92
+ config.validation?.forEach((v: any) => {
93
+ if (v.validationType === "required") {
94
+ parentSchema.required ??= [];
95
+ parentSchema.required.push(config.name);
96
+ } else if (v.validationType === "readOnly") {
97
+ fieldSchema.type = "string";
98
+ fieldSchema.disabled = true;
99
+ } else {
100
+ fieldSchema.type = "string";
101
+ fieldSchema[v.validationType] = isNaN(v.validationValue)
102
+ ? v.validationValue
103
+ : Number(v.validationValue);
163
104
  }
105
+ });
106
+ if (config.type === "Select" && config.value?.length) {
107
+ fieldSchema.oneOf = config.value.map((v: any) => ({
108
+ const: v.value,
109
+ title: v.label,
110
+ }));
111
+ }
112
+ if (config.type === "MultipleSelect" && config.value?.length) {
113
+ fieldSchema.type = "array";
114
+ fieldSchema.items = {
115
+ oneOf: config.value.map((v: any) => ({
116
+ const: v.value,
117
+ title: v.label,
118
+ })),
119
+ };
164
120
  }
165
- return schema;
166
121
  }
167
122
 
123
+ export const buildSchema = (config) => {
124
+ buildSchemaFromConfig(config, schema)
125
+ return schema;
126
+ }
168
127
 
169
128
  const buildUiSchema = (config: any, store?: any) => {
170
129
  let elements: any = {};
171
130
  const componentScope = `#/properties/${config.name}`;
172
131
  switch (config.type) {
132
+ case "OTP_Input":
133
+ elements = buildOTP_Input(config, componentScope);
134
+ break;
173
135
  case "TreeMap":
174
136
  elements = buildTreeMap(config, componentScope)
175
137
  break;
@@ -188,6 +150,9 @@ const buildUiSchema = (config: any, store?: any) => {
188
150
  case "PopUp":
189
151
  elements = buildPopUp(config, componentScope);
190
152
  break;
153
+ case "PopOver":
154
+ elements = buildPopOver(config, componentScope);
155
+ break;
191
156
  case "FileInput":
192
157
  elements = buildFileInput(config, componentScope);
193
158
  break;
@@ -206,6 +171,9 @@ const buildUiSchema = (config: any, store?: any) => {
206
171
  case "WrapperSection":
207
172
  elements = buildWrapperSection(config, componentScope);
208
173
  break;
174
+ case "HorizontalLayout":
175
+ elements = buildHorizontalLayout(config, componentScope);
176
+ break;
209
177
  case "Text":
210
178
  elements = buildTextField(config, componentScope);
211
179
  break;
@@ -225,6 +193,9 @@ const buildUiSchema = (config: any, store?: any) => {
225
193
 
226
194
  elements = buildButton(config, componentScope);
227
195
  break;
196
+ case "ButtonGroup":
197
+ elements = buildButtonGroup(config, componentScope);
198
+ break;
228
199
  case "Table":
229
200
  elements = buildTable(config, componentScope);
230
201
  break;
@@ -249,6 +220,12 @@ const buildUiSchema = (config: any, store?: any) => {
249
220
  case "card":
250
221
  elements = buildCard(config, componentScope, store);
251
222
  break;
223
+ case "MetricCard":
224
+ elements = buildMetricCard(config, componentScope, store);
225
+ break;
226
+ case "HierarchyChart":
227
+ elements = buildHierarchyChart(config, componentScope, store);
228
+ break;
252
229
  case "Graph":
253
230
  switch (config.graphType) {
254
231
  case "BarGraph":
@@ -265,6 +242,12 @@ const buildUiSchema = (config: any, store?: any) => {
265
242
  case "HorizontalStackBarGraph":
266
243
  elements = buildHorizontalBarGraph(config, componentScope);
267
244
  break;
245
+ case "AreaGraph":
246
+ elements = buildAreaGraph(config, componentScope);
247
+ break;
248
+ case "StackBarLineGraph":
249
+ elements = buildStackBarLineGraph(config, componentScope);
250
+ break;
268
251
  default:
269
252
  elements = buildStackbarGraph(config, componentScope);
270
253
  break;
@@ -307,6 +290,14 @@ const buildUiSchema = (config: any, store?: any) => {
307
290
  case "Thought":
308
291
  elements = buildThoughtOfTheDay(config, componentScope);
309
292
  break;
293
+ case "Image":
294
+ elements = buildImage(config, componentScope);
295
+ break;
296
+ case "Camera":
297
+ elements = buildCamera(config, componentScope)
298
+ break;
299
+ case "PdfViewer":
300
+ elements = buildPdfViewer(config, componentScope);
310
301
  break;
311
302
  default:
312
303
  schema = {
@@ -319,7 +310,17 @@ const buildUiSchema = (config: any, store?: any) => {
319
310
 
320
311
  if (config?.elements) {
321
312
  if (config?.type === "LeaderBoard") {
322
- return elements;
313
+ const rowElements = []
314
+ config.elements.map((cellElem) => {
315
+ const commonProperties = {
316
+ accessorKey: cellElem.name,
317
+ type: cellElem.type === "ColumnGroup" ? "ColumnGroup" : cellElem.columnFormat,
318
+ header: cellElem.label || cellElem.name,
319
+ columnKey: cellElem.columnKey
320
+ }
321
+ rowElements.push({ ...commonProperties })
322
+ })
323
+ elements.elements = rowElements;
323
324
  }
324
325
  else if (config.type == "ColumnGroup") {
325
326
  const sizeMap = {}
@@ -329,12 +330,26 @@ const buildUiSchema = (config: any, store?: any) => {
329
330
  });
330
331
  }
331
332
  elements.elements = config.elements.map((cellElem, elemInd) => {
332
- return {
333
+ const commonProperties = {
333
334
  accessorKey: cellElem.name,
335
+ type: cellElem.type === "ColumnGroup" ? "ColumnGroup" : cellElem.columnFormat,
334
336
  header: cellElem.label || cellElem.name,
335
337
  size: sizeMap[cellElem.name] || 180,
336
- type: cellElem.columnFormat,
337
- elements: cellElem.type == "ColumnGroup" ? cellElem.elements.map((childCellElem) => buildUiSchema(childCellElem, store)) : []
338
+ enableColumnFilter: cellElem.enableFilter === "No" ? false : true,
339
+ columnFilterModeOptions: cellElem.filteringOptions,
340
+ enableSorting: cellElem.enableSorting === "No" ? false : true,
341
+ columnKey: cellElem.columnKey,
342
+ dateFormat: cellElem.dateFormat,
343
+ }
344
+ if (cellElem.type) {
345
+ const tableElem = {
346
+ widget: cellElem.type != "ColumnGroup" ? buildUiSchema(cellElem, store) : undefined,
347
+ ...commonProperties,
348
+ ...(cellElem.type === "ColumnGroup" ? buildUiSchema(cellElem, store) : {})
349
+ }
350
+ return tableElem
351
+ } else {
352
+ return { ...commonProperties }
338
353
  }
339
354
  })
340
355
  } else if (config.type == "Table") {
@@ -351,13 +366,14 @@ const buildUiSchema = (config: any, store?: any) => {
351
366
  config.elements.filter((cellElem, elemInd) => {
352
367
  const commonProperties = {
353
368
  accessorKey: cellElem.name,
354
- type: cellElem.columnFormat,
369
+ type: cellElem.type === "ColumnGroup" ? "ColumnGroup" : cellElem.columnFormat,
355
370
  header: cellElem.label || cellElem.name,
356
371
  size: sizeMap[cellElem.name] || 180,
357
372
  enableColumnFilter: cellElem.enableFilter === "No" ? false : true,
358
373
  columnFilterModeOptions: cellElem.filteringOptions,
359
374
  enableSorting: cellElem.enableSorting === "No" ? false : true,
360
- columnKey: cellElem.columnKey
375
+ columnKey: cellElem.columnKey,
376
+ dateFormat: cellElem.dateFormat,
361
377
  }
362
378
  if (cellElem.type) {
363
379
  if (cellElem.elementType == "action") {
@@ -367,14 +383,13 @@ const buildUiSchema = (config: any, store?: any) => {
367
383
  }
368
384
  if (cellElem.elementType == "tableHeader") {
369
385
  const headerElem = buildUiSchema(cellElem, store);
370
- tableHeaderElements.push({widget:headerElem});
386
+ tableHeaderElements.push({ widget: headerElem });
371
387
  return false;
372
388
  }
373
389
  const tableElem = {
374
390
  widget: cellElem.type != "ColumnGroup" ? buildUiSchema(cellElem, store) : undefined,
375
- elements: cellElem.type == "ColumnGroup" ? cellElem.elements.map((childCellElem) => buildUiSchema(childCellElem, store)) : [],
376
- ...commonProperties
377
-
391
+ ...commonProperties,
392
+ ...(cellElem.type === "ColumnGroup" ? buildUiSchema(cellElem, store) : {})
378
393
  }
379
394
  rowElements.push(tableElem)
380
395
  } else {
@@ -392,6 +407,11 @@ const buildUiSchema = (config: any, store?: any) => {
392
407
  });
393
408
  }
394
409
  }
410
+ if (config.tabLabelElements) {
411
+ elements.tabLabelElements = config.tabLabelElements.map((e: any, elemInd: number) => {
412
+ return buildUiSchema(e, store)
413
+ });
414
+ }
395
415
  return elements;
396
416
  }
397
417
 
@@ -16,6 +16,12 @@ export const buildUploadFile = (config, componentScope) => {
16
16
  if (config.required) {
17
17
  UploadFile.config.main.required = true;
18
18
  }
19
+ if (config.toolTip) {
20
+ UploadFile.config.main.toolTip = config.toolTip;
21
+ }
22
+ if (config.toolTipPosition) {
23
+ UploadFile.config.main.toolTipPosition = config.toolTipPosition;
24
+ }
19
25
  UploadFile.config.main.errorMessage = config.errorMessage;
20
26
  return UploadFile;
21
27
  }
@@ -8,8 +8,13 @@ export const buildWrapperSection = (config, componentScope) => {
8
8
  wrapper.config.main.label = config.label;
9
9
  wrapper.config.main.divider = config.divider === "YES" ? true : false;
10
10
  wrapper.config.main.isAccordion = config.isAccordion === "No" ? false : true;
11
- if(config.defaultStyle){
12
- wrapper.config.defaultStyle = config.defaultStyle ==="YES" ? true : false;
11
+ wrapper.config.main.defaultClosed = config.defaultClosed === "YES" ? true : false;
12
+ wrapper.config.main.icon = config.iconUrl;
13
+ wrapper.config.main.rowSpacing = Number(config.rowSpacing);
14
+ wrapper.config.main.columnSpacing = Number(config.columnSpacing);
15
+ wrapper.config.main.spacing = Number(config.spacing);
16
+ if (config.defaultStyle) {
17
+ wrapper.config.defaultStyle = config.defaultStyle === "YES" ? true : false;
13
18
  }
14
19
  if (config.style) {
15
20
  wrapper.config.style = JSON.parse(config.style)
@@ -7,7 +7,10 @@
7
7
  },
8
8
 
9
9
  config: { layout: { xs: 6, sm: 6, md: 4, lg: 3 },
10
- main: {},
10
+ main: {
11
+ iconName: "",
12
+ onClick: "onClick",
13
+ },
11
14
  style:{
12
15
  // fontWeight:300
13
16
  }