impaktapps-ui-builder 0.0.275 → 0.0.277

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 (52) hide show
  1. package/dist/impaktapps-ui-builder.es.js +2641 -2247
  2. package/dist/impaktapps-ui-builder.es.js.map +1 -1
  3. package/dist/impaktapps-ui-builder.umd.js +14 -14
  4. package/dist/impaktapps-ui-builder.umd.js.map +1 -1
  5. package/dist/src/impaktapps-ui-builder/builder/build/buildButton.d.ts +1 -0
  6. package/dist/src/impaktapps-ui-builder/builder/build/buildConfig.d.ts +1 -0
  7. package/dist/src/impaktapps-ui-builder/builder/build/buildEmptyBox.d.ts +1 -0
  8. package/dist/src/impaktapps-ui-builder/builder/build/buildLineGraph.d.ts +1 -0
  9. package/dist/src/impaktapps-ui-builder/builder/build/buildRadio.d.ts +1 -0
  10. package/dist/src/impaktapps-ui-builder/builder/build/buildSchema.d.ts +6 -0
  11. package/dist/src/impaktapps-ui-builder/builder/build/buildUiSchema.d.ts +5 -4
  12. package/dist/src/impaktapps-ui-builder/builder/build/uischema/apiSection.d.ts +3 -0
  13. package/dist/src/impaktapps-ui-builder/builder/build/uischema/button.d.ts +1 -0
  14. package/dist/src/impaktapps-ui-builder/builder/build/uischema/cardSlider.d.ts +1 -6
  15. package/dist/src/impaktapps-ui-builder/builder/build/uischema/coreSection.d.ts +6 -20
  16. package/dist/src/impaktapps-ui-builder/builder/build/uischema/graph.d.ts +1 -0
  17. package/dist/src/impaktapps-ui-builder/builder/build/uischema/leaderBoard.d.ts +8 -1
  18. package/dist/src/impaktapps-ui-builder/builder/build/uischema/speedoMeter.d.ts +9 -3
  19. package/dist/src/impaktapps-ui-builder/builder/build/uischema/validationSections.d.ts +54 -0
  20. package/dist/src/impaktapps-ui-builder/lib/index.d.ts +2 -0
  21. package/dist/src/impaktapps-ui-builder/runtime/services/events.d.ts +4 -1
  22. package/package.json +1 -1
  23. package/src/impaktapps-ui-builder/builder/build/buildButton.ts +6 -1
  24. package/src/impaktapps-ui-builder/builder/build/buildCard.ts +14 -7
  25. package/src/impaktapps-ui-builder/builder/build/buildConfig.ts +10 -0
  26. package/src/impaktapps-ui-builder/builder/build/buildEmptyBox.ts +11 -0
  27. package/src/impaktapps-ui-builder/builder/build/buildHorizontalBarGraph.ts +4 -2
  28. package/src/impaktapps-ui-builder/builder/build/buildLineGraph.ts +28 -21
  29. package/src/impaktapps-ui-builder/builder/build/buildPieGraph.ts +12 -16
  30. package/src/impaktapps-ui-builder/builder/build/buildRadio.ts +35 -0
  31. package/src/impaktapps-ui-builder/builder/build/buildSchema.ts +32 -0
  32. package/src/impaktapps-ui-builder/builder/build/buildSpeedoMeter.ts +21 -8
  33. package/src/impaktapps-ui-builder/builder/build/buildStackBarGraph.ts +2 -1
  34. package/src/impaktapps-ui-builder/builder/build/buildTimer.ts +2 -1
  35. package/src/impaktapps-ui-builder/builder/build/buildUiSchema.ts +60 -44
  36. package/src/impaktapps-ui-builder/builder/build/uischema/apiSection.ts +2 -0
  37. package/src/impaktapps-ui-builder/builder/build/uischema/buildPropertiesSection.ts +79 -45
  38. package/src/impaktapps-ui-builder/builder/build/uischema/button.ts +2 -1
  39. package/src/impaktapps-ui-builder/builder/build/uischema/cardSlider.ts +1 -1
  40. package/src/impaktapps-ui-builder/builder/build/uischema/coreSection.ts +11 -2
  41. package/src/impaktapps-ui-builder/builder/build/uischema/graph.ts +1 -0
  42. package/src/impaktapps-ui-builder/builder/build/uischema/leaderBoard.ts +4 -1
  43. package/src/impaktapps-ui-builder/builder/build/uischema/speedoMeter.ts +5 -4
  44. package/src/impaktapps-ui-builder/builder/build/uischema/validationSections.ts +88 -0
  45. package/src/impaktapps-ui-builder/builder/elements/UiSchema/Component/schema.ts +41 -0
  46. package/src/impaktapps-ui-builder/builder/elements/UiSchema/Component/uiSchema.ts +9 -2
  47. package/src/impaktapps-ui-builder/builder/elements/UiSchema/event/uiSchema.ts +1 -0
  48. package/src/impaktapps-ui-builder/builder/services/component.ts +27 -24
  49. package/src/impaktapps-ui-builder/builder/services/pageMaster.ts +2 -0
  50. package/src/impaktapps-ui-builder/lib/index.ts +2 -0
  51. package/src/impaktapps-ui-builder/runtime/services/events.ts +37 -8
  52. package/src/impaktapps-ui-builder/runtime/services/service.ts +18 -10
@@ -17,6 +17,7 @@ export declare const buildButton: (config: any, componentScope: string) => {
17
17
  color: string;
18
18
  type: string;
19
19
  startIcon: string;
20
+ styleDefault: boolean;
20
21
  icon: string;
21
22
  onClick: string;
22
23
  size: string;
@@ -1,3 +1,4 @@
1
1
  declare const _default: (FormData: any) => any;
2
2
  export default _default;
3
3
  export declare const createLayoutFormat: (config: any[]) => any;
4
+ export declare const flatObjectValueInArray: (config: any[]) => any[];
@@ -0,0 +1 @@
1
+ export declare const buildEmptyBox: (config: any, componentScope: any) => any;
@@ -0,0 +1 @@
1
+ export declare const buildLineGraph: (config: any, componentScope: any) => any;
@@ -0,0 +1 @@
1
+ export declare const buildRadio: (config: any, componentScope: any) => any;
@@ -0,0 +1,6 @@
1
+ export declare const buildSchema: (config: any) => {
2
+ type: string;
3
+ properties: {};
4
+ required: any[];
5
+ };
6
+ export default buildSchema;
@@ -1,6 +1,7 @@
1
- declare const buildUiSchema: (config: any) => any;
2
- export default buildUiSchema;
3
- export declare const buildSchema: (config: any) => {
1
+ export declare let schema: {
2
+ type: string;
4
3
  properties: {};
4
+ required: any[];
5
5
  };
6
- export declare const buildProperties: (config: any) => {};
6
+ declare const buildUiSchema: (config: any) => any;
7
+ export default buildUiSchema;
@@ -29,6 +29,7 @@ export declare const APISection: {
29
29
  scope: string;
30
30
  options: {
31
31
  widget: string;
32
+ elementLabelProp?: undefined;
32
33
  detail?: undefined;
33
34
  };
34
35
  config: {
@@ -54,6 +55,7 @@ export declare const APISection: {
54
55
  scope: string;
55
56
  options: {
56
57
  widget: string;
58
+ elementLabelProp?: undefined;
57
59
  detail?: undefined;
58
60
  };
59
61
  config: {
@@ -76,6 +78,7 @@ export declare const APISection: {
76
78
  scope: string;
77
79
  layout: number;
78
80
  options: {
81
+ elementLabelProp: string;
79
82
  detail: {
80
83
  type: string;
81
84
  elements: {
@@ -17,6 +17,7 @@ declare const _default: {
17
17
  color: string;
18
18
  type: string;
19
19
  startIcon: string;
20
+ styleDefault: boolean;
20
21
  icon: string;
21
22
  onClick: string;
22
23
  size: string;
@@ -6,12 +6,7 @@ declare const _default: {
6
6
  };
7
7
  elements: any[];
8
8
  config: {
9
- layout: {
10
- xs: number;
11
- sm: number;
12
- md: number;
13
- lg: number;
14
- };
9
+ layout: number;
15
10
  main: {};
16
11
  };
17
12
  };
@@ -5,6 +5,7 @@ export declare const CoreSection: {
5
5
  scope: string;
6
6
  options: {
7
7
  widget: string;
8
+ elementLabelProp?: undefined;
8
9
  detail?: undefined;
9
10
  };
10
11
  config: {
@@ -29,6 +30,7 @@ export declare const CoreSection: {
29
30
  scope: string;
30
31
  options: {
31
32
  widget: string;
33
+ elementLabelProp?: undefined;
32
34
  detail?: undefined;
33
35
  };
34
36
  config: {
@@ -59,6 +61,7 @@ export declare const CoreSection: {
59
61
  };
60
62
  options: {
61
63
  widget: string;
64
+ elementLabelProp?: undefined;
62
65
  detail?: undefined;
63
66
  };
64
67
  layout?: undefined;
@@ -67,9 +70,10 @@ export declare const CoreSection: {
67
70
  scope: string;
68
71
  layout: number;
69
72
  options: {
73
+ elementLabelProp: string;
70
74
  detail: {
71
75
  type: string;
72
- elements: ({
76
+ elements: {
73
77
  type: string;
74
78
  scope: string;
75
79
  options: {
@@ -90,25 +94,7 @@ export declare const CoreSection: {
90
94
  }[];
91
95
  };
92
96
  };
93
- } | {
94
- type: string;
95
- scope: string;
96
- options: {
97
- widget: string;
98
- };
99
- config: {
100
- layout: {
101
- xs: number;
102
- sm: number;
103
- md: number;
104
- lg: number;
105
- };
106
- main: {
107
- label: string;
108
- options?: undefined;
109
- };
110
- };
111
- })[];
97
+ }[];
112
98
  };
113
99
  widget?: undefined;
114
100
  };
@@ -113,6 +113,7 @@ export declare const LineGraph: {
113
113
  widget: string;
114
114
  };
115
115
  config: {
116
+ layout: number;
116
117
  main: {
117
118
  type: string;
118
119
  header: string;
@@ -7,10 +7,17 @@ declare const _default: {
7
7
  label: string;
8
8
  divider: boolean;
9
9
  };
10
+ style: {
11
+ wrapperStyle: {
12
+ height: {
13
+ xs: number;
14
+ sm: number;
15
+ };
16
+ };
17
+ };
10
18
  wrapperStyle: {
11
19
  position: string;
12
20
  width: string;
13
- height: number;
14
21
  };
15
22
  };
16
23
  elements: ({
@@ -5,10 +5,17 @@ declare const _default: {
5
5
  widget: string;
6
6
  };
7
7
  config: {
8
- layout: number;
8
+ layout: {
9
+ xs: number;
10
+ sm: number;
11
+ md: number;
12
+ lg: number;
13
+ };
14
+ width: number;
15
+ segments: string;
9
16
  main: {
10
17
  currentValueText: string;
11
- customSegmentLabels: {};
18
+ customSegmentLabels: any[];
12
19
  data: {
13
20
  maxValue: number;
14
21
  value: number;
@@ -22,7 +29,6 @@ declare const _default: {
22
29
  needleColor: string;
23
30
  startColor: string;
24
31
  textColor: string;
25
- segments: number;
26
32
  endColor: string;
27
33
  containerStyle: {
28
34
  background: string;
@@ -0,0 +1,54 @@
1
+ export declare const ValidationSection: {
2
+ type: string;
3
+ elements: {
4
+ type: string;
5
+ scope: string;
6
+ layout: number;
7
+ options: {
8
+ elementLabelProp: string;
9
+ detail: {
10
+ type: string;
11
+ elements: ({
12
+ type: string;
13
+ scope: string;
14
+ options: {
15
+ widget: string;
16
+ };
17
+ config: {
18
+ layout: {
19
+ xs: number;
20
+ sm: number;
21
+ md: number;
22
+ lg: number;
23
+ };
24
+ main: {
25
+ label: string;
26
+ options: {
27
+ value: string;
28
+ label: string;
29
+ }[];
30
+ };
31
+ };
32
+ } | {
33
+ type: string;
34
+ scope: string;
35
+ options: {
36
+ widget: string;
37
+ };
38
+ config: {
39
+ layout: {
40
+ xs: number;
41
+ sm: number;
42
+ md: number;
43
+ lg: number;
44
+ };
45
+ main: {
46
+ label: string;
47
+ options?: undefined;
48
+ };
49
+ };
50
+ })[];
51
+ };
52
+ };
53
+ }[];
54
+ };
@@ -2,6 +2,8 @@ export { default as pageMaster } from "../builder/services/pageMaster";
2
2
  export { default as pageMasterEvents } from "../builder/services/event";
3
3
  export { default as pageMasterComponents } from "../builder/services/component";
4
4
  export { default as pageService } from "../runtime/services/service";
5
+ export { schema } from "../builder/build/buildUiSchema";
5
6
  export { default as buildConfig } from "../builder/build/buildConfig";
6
7
  export { default as buildUiSchema } from "../builder/build/buildUiSchema";
8
+ export { default as buildSchema } from "../builder/build/buildSchema";
7
9
  export { default as clearPreviousCache } from "../builder/services/clearLocalStorage";
@@ -1,4 +1,7 @@
1
- export declare const executeEvents: (config: any, componentName: string, store: any, dynamicData: any, userValue: any, service: any, serviceHolder: any, eventGroups?: any, parentEventOutput?: any) => Promise<void>;
1
+ export declare const executeEvents: (config: any, componentName: string, store: any, dynamicData: any, userValue: any, service: any, serviceHolder: any, eventGroups?: any, parentEventOutput?: any) => Promise<{
2
+ response: any;
3
+ events: any;
4
+ }>;
2
5
  export declare function buildApiPayload(compConfig: any, body: any, headers: any, store: any, dynamicData: any, userValue: any, service: any): Promise<{
3
6
  body: any;
4
7
  headers: any;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "impaktapps-ui-builder",
3
- "version": "0.0.275",
3
+ "version": "0.0.277",
4
4
  "scripts": {
5
5
  "dev": "vite",
6
6
  "build": "tsc && vite build",
@@ -14,6 +14,9 @@ export const buildButton = (config:any,componentScope:string) =>{
14
14
  if(config.layout){
15
15
  button.config.layout = createLayoutFormat(config.layout)
16
16
  }
17
+ if(config.defaultStyle){
18
+ button.config.main.styleDefault = config.defaultStyle==="true"?true:false;
19
+ }
17
20
  button.scope = componentScope;
18
21
  if (config.style) {
19
22
  button.config.style = JSON.parse(config.style)
@@ -22,8 +25,10 @@ export const buildButton = (config:any,componentScope:string) =>{
22
25
  button.config.main.size = config.size
23
26
  }
24
27
  if (config.color) {
25
- button.config.main.size = config.color
28
+ button.config.main.color = config.color
26
29
  }
30
+ if(config.label){
27
31
  button.config.main.name = config.label;
32
+ }
28
33
  return button;
29
34
  }
@@ -7,16 +7,23 @@ export const buildCard = (config,componentScope) =>{
7
7
  if (config.style) {
8
8
  card.config.style = JSON.parse(config.style)
9
9
  }
10
- card.elements[0].scope = `#/properties/${config.name.replace(/ /g, "")}/value`
11
- card.elements[1].scope = `#/properties/${config.name.replace(/ /g, "")}/url`
12
- card.elements[2].scope = `#/properties/${config.name.replace(/ /g, "")}/description`
10
+ card.elements[0].scope = `#/properties/${config.name}/properties/value`
11
+ card.elements[1].scope = `#/properties/${config.name}/properties/url`
12
+ card.elements[2].scope = `#/properties/${config.name}/properties/description`
13
13
  if(config.layout){
14
14
  card.config.layout = createLayoutFormat(config.layout)
15
15
  }
16
-
17
- card.elements[0].config.main.heading = config.label;
18
- card.elements[1].config.main.url = config.url;
19
- card.elements[2].config.main.heading = config.description;
16
+ // if(config.label){
17
+ // card.elements[0].config.main.heading = config.label;
18
+ // }
19
+ // if(config.url){
20
+ // card.elements[1].config.main.url = config.url;
21
+ // }
22
+ // if(config.description){
23
+ // card.elements[2].config.main.heading = config.description;
24
+ // }
25
+
26
+
20
27
 
21
28
  return card;
22
29
  }
@@ -7,6 +7,9 @@ export default (FormData: any) => {
7
7
  // component.layout = createData(FormData?.layout, "layout");
8
8
  // delete formData.layout
9
9
  // }
10
+ // if(!formData.type ){
11
+ // component.type = "page";
12
+ // }
10
13
  if(formData.pageName){
11
14
  delete formData.pageName
12
15
  }
@@ -37,3 +40,10 @@ export const createLayoutFormat = (config: any[]) => {
37
40
  })
38
41
  return data;
39
42
  };
43
+ export const flatObjectValueInArray = (config:any[])=>{
44
+ const keyName = Object.keys(config[0])[0]
45
+ const data = config.map((e)=>{
46
+ return e[keyName]
47
+ })
48
+ return data;
49
+ }
@@ -0,0 +1,11 @@
1
+ import _ from "lodash";
2
+ import { createLayoutFormat } from "./buildConfig";
3
+ import emptyBox from "./uischema/emptyBox";
4
+
5
+ export const buildEmptyBox = (config,componentScope) =>{
6
+ const EmptyBox: any = _.cloneDeep(emptyBox);
7
+ if (config.layout) {
8
+ EmptyBox.config.layout = createLayoutFormat(config.layout);
9
+ }
10
+ return EmptyBox;
11
+ }
@@ -1,11 +1,13 @@
1
+ import { createLayoutFormat } from "./buildConfig";
1
2
  import { HorizontalBarGraph } from "./uischema/graph";
2
3
  import _ from "lodash";
3
4
 
4
5
 
5
6
  const buildHorizontalBarGraph = (config:any,componentScope:string) => {
6
7
  const horizontalBarGraph: any = _.cloneDeep(HorizontalBarGraph);
8
+ horizontalBarGraph.scope = componentScope;
7
9
  if (config.layout) {
8
- horizontalBarGraph.config.layout = config.layout;
10
+ horizontalBarGraph.config.layout = createLayoutFormat(config.layout);
9
11
  }
10
12
  horizontalBarGraph.scope = componentScope;
11
13
  horizontalBarGraph.config.main.header = config.heading;
@@ -17,7 +19,7 @@ const buildHorizontalBarGraph = (config:any,componentScope:string) => {
17
19
  config.containerBackground;
18
20
  }
19
21
  if (config.height) {
20
- horizontalBarGraph.config.containerStyle.height =
22
+ horizontalBarGraph.config.style.containerStyle.height =
21
23
  config.height;
22
24
  }
23
25
  if (config.bottomLabel) {
@@ -1,25 +1,32 @@
1
+ import { createLayoutFormat, flatObjectValueInArray } from "./buildConfig";
1
2
  import { LineGraph } from "./uischema/graph";
2
3
  import _ from "lodash";
3
4
 
4
- const buildLineGraph = (config,componentScope) =>{
5
- const lineGraph: any = _.cloneDeep(LineGraph);
6
- if (config.layout) {
7
- lineGraph.config.layout = config.layout;
8
- }
9
- lineGraph.config.main.heading = config.heading;
10
- if (config.containerBackground) {
11
- lineGraph.config.containerStyle.background =
12
- config.containerBackground;
13
- }
14
- if (config.height) {
15
- lineGraph.config.containerStyle.height = config.height;
16
- }
17
- if (config.bottomLabel) {
18
- lineGraph.config.main.bottomLabel = config.bottomLabel;
19
- }
20
- if (config.leftLabel) {
21
- lineGraph.config.main.leftLabel = config.leftLabel;
22
- }
23
- lineGraph.scope = componentScope;
24
- return lineGraph;
5
+ export const buildLineGraph = (config, componentScope) => {
6
+ const lineGraph: any = _.cloneDeep(LineGraph);
7
+ if (config.layout) {
8
+ lineGraph.config.layout = createLayoutFormat(config.layout);
9
+ }
10
+ lineGraph.config.main.header = config.heading;
11
+ if (config.height) {
12
+ lineGraph.config.style.containerStyle.height = config.height;
13
+ }
14
+ if (config.bottomLabel) {
15
+ lineGraph.config.main.bottomLabel = config.bottomLabel;
16
+ }
17
+ if (config.leftLabel) {
18
+ lineGraph.config.main.leftLabel = config.leftLabel;
19
+ }
20
+ if (config.legendHide) {
21
+ lineGraph.config.main.legendAvailabe = config.legendHide==="YES"?false:true;
22
+ }
23
+ if (config.legendLabels) {
24
+ lineGraph.config.main.tooltipDataKey = flatObjectValueInArray(config.legendLabels);
25
+ }
26
+
27
+ if (config.pieArcColors) {
28
+ lineGraph.config.style.lineStyle.colorRange = flatObjectValueInArray(config.pieArcColors);
29
+ }
30
+ lineGraph.scope = componentScope;
31
+ return lineGraph;
25
32
  }
@@ -1,31 +1,27 @@
1
+ import { createLayoutFormat, flatObjectValueInArray } from "./buildConfig";
1
2
  import { PieGraph } from "./uischema/graph";
2
3
  import _ from "lodash";
3
-
4
+ // flatObjectValueInArray
4
5
  export const buildPieGraph = (config,componentScope) =>{
5
6
  const pieGraph: any = _.cloneDeep(PieGraph);
6
7
  if (config.layout) {
7
- pieGraph.config.layout = config.layout;
8
- }
9
- if (config.containerBackground) {
10
- pieGraph.config.style.containerStyle.background =
11
- config.containerBackground;
8
+ pieGraph.config.layout = createLayoutFormat(config.layout);
12
9
  }
13
10
  if (config.height) {
14
11
  pieGraph.config.style.containerStyle.height = config.height;
15
12
  }
16
- if (config.legendAvailabe) {
17
- pieGraph.config.main.legendAvailabe = config.legendAvailabe==="YES"?false:true;
13
+ if (config.legendHide) {
14
+ pieGraph.config.main.legendAvailabe = config.legendHide==="YES"?false:true;
18
15
  }
19
16
  pieGraph.scope = componentScope;
20
17
  pieGraph.config.main.header = config.heading;
21
- if(config.bottomLabel){
22
- pieGraph.config.main.bottomLabel = config.bottomLabel;
23
- }
24
- if(config.leftLabel){
25
- pieGraph.config.main.leftLabel = config.leftLabel;
26
- }
27
- if(config.tooltipDataKey){
28
- pieGraph.config.main.tooltipDataKey = config.tooltipDataKey;
18
+
19
+ if(config.legendLabels){
20
+ pieGraph.config.main.tooltipDataKey = flatObjectValueInArray(config.legendLabels);
29
21
  }
22
+
23
+ if(config.pieArcColors){
24
+ pieGraph.config.style.pieStyle.colorRange = flatObjectValueInArray(config.pieArcColors);
25
+ }
30
26
  return pieGraph;
31
27
  }
@@ -0,0 +1,35 @@
1
+ import _ from "lodash";
2
+ import { createLayoutFormat } from "./buildConfig";
3
+
4
+ const RadioUiSchema = {
5
+ type: "Control",
6
+ scope: "#/properties/invoiceEnabled",
7
+
8
+ options: {
9
+ widget: "RadioInputField",
10
+ },
11
+ config: {
12
+ layout: { xs: 11, sm: 11, md: 5.5, lg: 5.5 },
13
+ main: {
14
+ label: "Enabled",
15
+ options: ["YES", "NO"],
16
+ errorMessage: "Enabled is not marked as YES or NO",
17
+ },
18
+ },
19
+ };
20
+
21
+ export const buildRadio = (config,componentScope) => {
22
+ const Radio: any = _.cloneDeep(RadioUiSchema);
23
+ Radio.scope = componentScope;
24
+ Radio.config.main.heading = config.label
25
+ if(config.layout){
26
+ Radio.config.layout = createLayoutFormat(config.layout)
27
+ }
28
+ if (config.sectionLabels) {
29
+ Radio.config.main.options = config.sectionLabels.map(e => e.label||e.Options);
30
+ }
31
+ if (config.style) {
32
+ Radio.config.style = JSON.parse(config.style)
33
+ }
34
+ return Radio;
35
+ }
@@ -0,0 +1,32 @@
1
+
2
+ const schema = {
3
+ type: "object",
4
+ properties: {},
5
+ required: []
6
+ };
7
+
8
+ export const buildSchema = (config: any) => {
9
+ function buildRule(configObj: any) {
10
+ if (configObj.validation) {
11
+ configObj.validation.forEach((rule: any) => {
12
+ if (!schema.properties[configObj.name]) {
13
+ schema.properties[configObj.name] = {};
14
+ }
15
+ if (rule.validationType === "required") {
16
+ schema.required.push(configObj.name)
17
+ } else {
18
+ schema.properties[configObj.name]["type"] = "string"
19
+ schema.properties[configObj.name][rule.validationType] =
20
+ isNaN(rule.validationValue) ?
21
+ rule.validationValue : Number(rule.validationValue)
22
+ }
23
+ });
24
+ }
25
+
26
+ }
27
+ buildRule(config)
28
+ console.log(schema)
29
+ window.localStorage.setItem("schemaDemo",JSON.stringify(schema))
30
+ return schema;
31
+ };
32
+ export default buildSchema;
@@ -1,3 +1,4 @@
1
+ import { createLayoutFormat } from "./buildConfig";
1
2
  import SpeedoMeter from "./uischema/speedoMeter";
2
3
  import _ from "lodash";
3
4
 
@@ -5,19 +6,31 @@ export const buildSpeedoMeter = (config:any,componentScope:string) => {
5
6
  const speedoMeter: any = _.cloneDeep(SpeedoMeter);
6
7
  speedoMeter.scope = componentScope;
7
8
  if (config.layout) {
8
- speedoMeter.config.layout = config.layout;
9
+ speedoMeter.config.layout = createLayoutFormat(config.layout);
9
10
  }
10
11
  if (config.heading) {
11
12
  speedoMeter.config.main.header = config.heading;
12
13
  }
13
-
14
- if (config.currentValueText) {
14
+ if (config.segments) {
15
+ speedoMeter.config.main.segments = config.segments;
16
+ }
17
+ if (config.style) {
18
+ const styleObj = JSON.parse(config.style)
19
+ if(styleObj?.style){
20
+ speedoMeter.config.style = {...speedoMeter.config.style,...styleObj.style}
21
+ }
22
+ if(styleObj?.containerStyle){
23
+ speedoMeter.config.style.containerStyle = {...speedoMeter.config.style.containerStyle,...styleObj.containerStyle}
24
+ }
25
+
26
+ }
27
+ if(config.width){
28
+ speedoMeter.config.main.width =
29
+ config.width;
30
+ }
31
+ if (config.speedoCaption) {
15
32
  speedoMeter.config.main.currentValueText =
16
- config.currentValueText;
17
- }
18
- if (config.customSegmentLabels) {
19
- speedoMeter.config.main.customSegmentLabels =
20
- config.customSegmentLabels;
33
+ config.speedoCaption;
21
34
  }
22
35
  if (config.data) {
23
36
  speedoMeter.config.main.data = config.data;
@@ -1,10 +1,11 @@
1
+ import { createLayoutFormat } from "./buildConfig";
1
2
  import { BarGraph } from "./uischema/graph";
2
3
  import _ from "lodash";
3
4
 
4
5
  export const buildStackbarGraph = (config:any,componentScope:string) => {
5
6
  const barGraph: any = _.cloneDeep(BarGraph);
6
7
  if (config.layout) {
7
- barGraph.config.layout = config.layout;
8
+ barGraph.config.layout = createLayoutFormat(config.layout);
8
9
  }
9
10
  if (config.legendHide) {
10
11
  barGraph.config.main.legendAvailable = false;
@@ -1,3 +1,4 @@
1
+ import { createLayoutFormat } from "./buildConfig";
1
2
  import Timer from "./uischema/timer";
2
3
  import _ from "lodash";
3
4
 
@@ -8,7 +9,7 @@ export const buildTimer = (config,componentScope)=>{
8
9
  timer.config.main.label = config.label;
9
10
  }
10
11
  if (config.layout) {
11
- timer.config.layout = config.layout;
12
+ timer.config.layout = createLayoutFormat(config.layout);
12
13
  }
13
14
  return timer;
14
15
  }