impaktapps-ui-builder 0.0.99 → 0.0.101-alpha.1

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 (62) hide show
  1. package/dist/impaktapps-ui-builder.es.js +1909 -1522
  2. package/dist/impaktapps-ui-builder.es.js.map +1 -1
  3. package/dist/impaktapps-ui-builder.umd.js +17 -17
  4. package/dist/impaktapps-ui-builder.umd.js.map +1 -1
  5. package/dist/src/impaktapps-ui-builder/builder/build/buildPdfViewer.d.ts +1 -0
  6. package/dist/src/impaktapps-ui-builder/builder/build/buildThoughtOfTheDay.d.ts +1 -0
  7. package/dist/src/impaktapps-ui-builder/builder/build/uischema/button.d.ts +0 -1
  8. package/dist/src/impaktapps-ui-builder/builder/build/uischema/card.d.ts +94 -23
  9. package/dist/src/impaktapps-ui-builder/builder/build/uischema/eventSection.d.ts +55 -2
  10. package/dist/src/impaktapps-ui-builder/builder/build/uischema/graph.d.ts +28 -21
  11. package/dist/src/impaktapps-ui-builder/builder/build/uischema/leaderBoard.d.ts +10 -301
  12. package/dist/src/impaktapps-ui-builder/builder/build/uischema/pdfViewer.d.ts +19 -0
  13. package/dist/src/impaktapps-ui-builder/builder/build/uischema/progressBar.d.ts +6 -1
  14. package/dist/src/impaktapps-ui-builder/builder/build/uischema/tableSection.d.ts +50 -2
  15. package/dist/src/impaktapps-ui-builder/builder/build/uischema/thoughtOfTheDay.d.ts +17 -0
  16. package/dist/src/impaktapps-ui-builder/builder/build/uischema/timer.d.ts +1 -14
  17. package/dist/src/impaktapps-ui-builder/builder/elements/UiSchema/PageMaster/schema.d.ts +3 -0
  18. package/dist/src/impaktapps-ui-builder/builder/elements/UiSchema/event/schema.d.ts +3 -0
  19. package/dist/src/impaktapps-ui-builder/builder/services/component.d.ts +8 -2
  20. package/dist/src/impaktapps-ui-builder/builder/services/event.d.ts +5 -0
  21. package/dist/src/impaktapps-ui-builder/builder/services/pageMaster.d.ts +5 -0
  22. package/dist/src/impaktapps-ui-builder/builder/services/utils.d.ts +1 -1
  23. package/package.json +5 -1
  24. package/src/impaktapps-ui-builder/builder/build/buildAadharCard.ts +2 -0
  25. package/src/impaktapps-ui-builder/builder/build/buildCard.ts +7 -3
  26. package/src/impaktapps-ui-builder/builder/build/buildConfig.ts +7 -2
  27. package/src/impaktapps-ui-builder/builder/build/buildHorizontalBarGraph.ts +9 -21
  28. package/src/impaktapps-ui-builder/builder/build/buildInputSlider.ts +1 -1
  29. package/src/impaktapps-ui-builder/builder/build/buildLeaderboard.ts +18 -13
  30. package/src/impaktapps-ui-builder/builder/build/buildLineGraph.ts +3 -8
  31. package/src/impaktapps-ui-builder/builder/build/buildPdfViewer.ts +22 -0
  32. package/src/impaktapps-ui-builder/builder/build/buildPieGraph.ts +4 -15
  33. package/src/impaktapps-ui-builder/builder/build/buildRankCard.ts +4 -10
  34. package/src/impaktapps-ui-builder/builder/build/buildStackBarGraph.ts +8 -10
  35. package/src/impaktapps-ui-builder/builder/build/buildThoughtOfTheDay.ts +22 -0
  36. package/src/impaktapps-ui-builder/builder/build/buildUiSchema.ts +11 -0
  37. package/src/impaktapps-ui-builder/builder/build/buildUplaodFile.ts +16 -19
  38. package/src/impaktapps-ui-builder/builder/build/uischema/buildPropertiesSection.ts +13 -8
  39. package/src/impaktapps-ui-builder/builder/build/uischema/button.ts +0 -1
  40. package/src/impaktapps-ui-builder/builder/build/uischema/card.ts +103 -46
  41. package/src/impaktapps-ui-builder/builder/build/uischema/eventSection.ts +44 -0
  42. package/src/impaktapps-ui-builder/builder/build/uischema/graph.ts +9 -27
  43. package/src/impaktapps-ui-builder/builder/build/uischema/leaderBoard.ts +10 -366
  44. package/src/impaktapps-ui-builder/builder/build/uischema/pdfViewer.ts +18 -0
  45. package/src/impaktapps-ui-builder/builder/build/uischema/progressBar.ts +1 -1
  46. package/src/impaktapps-ui-builder/builder/build/uischema/rankCard.ts +1 -1
  47. package/src/impaktapps-ui-builder/builder/build/uischema/runnerBoyProgressBar.ts +1 -1
  48. package/src/impaktapps-ui-builder/builder/build/uischema/tableSection.ts +45 -1
  49. package/src/impaktapps-ui-builder/builder/build/uischema/thoughtOfTheDay.ts +14 -0
  50. package/src/impaktapps-ui-builder/builder/build/uischema/timer.ts +2 -16
  51. package/src/impaktapps-ui-builder/builder/elements/UiSchema/Component/schema.ts +6 -1
  52. package/src/impaktapps-ui-builder/builder/elements/UiSchema/Component/uiSchema.ts +424 -202
  53. package/src/impaktapps-ui-builder/builder/elements/UiSchema/PageMaster/schema.ts +4 -1
  54. package/src/impaktapps-ui-builder/builder/elements/UiSchema/PageMaster/uiSchema.ts +479 -167
  55. package/src/impaktapps-ui-builder/builder/elements/UiSchema/event/schema.ts +4 -1
  56. package/src/impaktapps-ui-builder/builder/elements/UiSchema/event/uiSchema.ts +339 -111
  57. package/src/impaktapps-ui-builder/builder/services/component.ts +94 -8
  58. package/src/impaktapps-ui-builder/builder/services/event.ts +19 -4
  59. package/src/impaktapps-ui-builder/builder/services/pageMaster.ts +20 -2
  60. package/src/impaktapps-ui-builder/builder/services/utils.ts +2 -2
  61. package/src/impaktapps-ui-builder/runtime/services/events.ts +24 -20
  62. package/src/impaktapps-ui-builder/runtime/services/service.ts +151 -47
@@ -0,0 +1,19 @@
1
+ declare const _default: {
2
+ type: string;
3
+ scope: string;
4
+ options: {
5
+ widget: string;
6
+ };
7
+ config: {
8
+ layout: {
9
+ xs: number;
10
+ sm: number;
11
+ md: number;
12
+ lg: number;
13
+ };
14
+ main: {
15
+ title: string;
16
+ };
17
+ };
18
+ };
19
+ export default _default;
@@ -5,7 +5,12 @@ 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
+ };
9
14
  main: {
10
15
  developOnlyProgresBar: boolean;
11
16
  bottomLabel_3: string;
@@ -9,7 +9,7 @@ export declare const TableSection: (theme: any) => {
9
9
  config: {
10
10
  main: {
11
11
  headerIcons: {
12
- elements: {
12
+ elements: ({
13
13
  widget: {
14
14
  type: string;
15
15
  scope: string;
@@ -30,7 +30,28 @@ export declare const TableSection: (theme: any) => {
30
30
  };
31
31
  };
32
32
  };
33
- }[];
33
+ } | {
34
+ widget: {
35
+ type: string;
36
+ scope: string;
37
+ options: {
38
+ widget: string;
39
+ };
40
+ config: {
41
+ main: {
42
+ onClick: string;
43
+ size: string;
44
+ icon: string;
45
+ iconLabel: string;
46
+ styleDefault: boolean;
47
+ color?: undefined;
48
+ };
49
+ style: {
50
+ mt: string;
51
+ };
52
+ };
53
+ };
54
+ })[];
34
55
  };
35
56
  disableAction: boolean;
36
57
  disableSelection: boolean;
@@ -59,6 +80,8 @@ export declare const TableSection: (theme: any) => {
59
80
  color: string;
60
81
  onClick: string;
61
82
  tooltipMessage: string;
83
+ styleDefault?: undefined;
84
+ disabled?: undefined;
62
85
  };
63
86
  style: {
64
87
  color: any;
@@ -82,6 +105,31 @@ export declare const TableSection: (theme: any) => {
82
105
  color: string;
83
106
  onClick: string;
84
107
  tooltipMessage: string;
108
+ styleDefault?: undefined;
109
+ disabled?: undefined;
110
+ };
111
+ style?: undefined;
112
+ };
113
+ };
114
+ accessorKey?: undefined;
115
+ } | {
116
+ header: string;
117
+ field: string;
118
+ flex: number;
119
+ widget: {
120
+ type: string;
121
+ scope: string;
122
+ options: {
123
+ widget: string;
124
+ };
125
+ config: {
126
+ main: {
127
+ icon: string;
128
+ onClick: string;
129
+ styleDefault: boolean;
130
+ disabled: boolean;
131
+ color?: undefined;
132
+ tooltipMessage?: undefined;
85
133
  };
86
134
  style?: undefined;
87
135
  };
@@ -0,0 +1,17 @@
1
+ declare const _default: {
2
+ type: string;
3
+ scope: string;
4
+ options: {
5
+ widget: string;
6
+ };
7
+ config: {
8
+ layout: {
9
+ xs: number;
10
+ sm: number;
11
+ md: number;
12
+ lg: number;
13
+ };
14
+ main: {};
15
+ };
16
+ };
17
+ export default _default;
@@ -12,20 +12,7 @@ declare const _default: {
12
12
  lg: number;
13
13
  };
14
14
  main: {};
15
- style: {
16
- digitContainer: {
17
- borderRadius: string;
18
- textShawdow: string;
19
- width: string;
20
- };
21
- container: {
22
- backgroundColor: string;
23
- borderRadius: string;
24
- };
25
- containerLabelColor: {
26
- color: string;
27
- };
28
- };
15
+ style: {};
29
16
  };
30
17
  };
31
18
  export default _default;
@@ -39,6 +39,9 @@ export declare const PageMasterSchema: {
39
39
  };
40
40
  };
41
41
  };
42
+ RemoveItemButton: {
43
+ disabled: boolean;
44
+ };
42
45
  };
43
46
  required: string[];
44
47
  };
@@ -68,6 +68,9 @@ export declare const EventSchema: {
68
68
  };
69
69
  };
70
70
  };
71
+ RemoveItemButton: {
72
+ disabled: boolean;
73
+ };
71
74
  };
72
75
  required: string[];
73
76
  };
@@ -1,7 +1,7 @@
1
- export declare const refreshPage: (type: string, store: any) => void;
1
+ export declare function refreshPage(type: string, store: any): void;
2
2
  declare const _default: (store: any, dynamicData: any, submitHandler: any, service: any) => {
3
3
  setPage: () => Promise<void>;
4
- refreshPage: (type: string, store: any) => void;
4
+ refreshPage: typeof refreshPage;
5
5
  getFormdata: () => any;
6
6
  getSchema: () => any;
7
7
  okHandler: () => void;
@@ -16,5 +16,11 @@ declare const _default: (store: any, dynamicData: any, submitHandler: any, servi
16
16
  backHandler: () => void;
17
17
  deletePopUpComponent: () => void;
18
18
  deletePopUpEvent: () => void;
19
+ copyPasteElement: (paramStore: any, setPage?: any) => void;
20
+ CopyElement: (paramStore: any, elementType: string) => void;
21
+ PasteElement: (setPage: any, elementType: string) => void;
22
+ RemoveItemButton: (paramStore?: any) => void;
23
+ elementPathHandler: (parentPath: string, rowId: any, elementType: string) => string;
24
+ ElementPathSetter: (uiSchema: any, copiedFormData?: any) => void;
19
25
  };
20
26
  export default _default;
@@ -76,6 +76,9 @@ declare const _default: (store: any, dynamicData: any, submitHandler: any, servi
76
76
  };
77
77
  };
78
78
  };
79
+ RemoveItemButton: {
80
+ disabled: boolean;
81
+ };
79
82
  };
80
83
  required: string[];
81
84
  };
@@ -87,5 +90,7 @@ declare const _default: (store: any, dynamicData: any, submitHandler: any, servi
87
90
  deleteEvent: () => Promise<void>;
88
91
  backHandler: () => void;
89
92
  deletePopUpEvent: () => void;
93
+ copyPasteElement: () => void;
94
+ RemoveItemButton: () => void;
90
95
  };
91
96
  export default _default;
@@ -50,6 +50,9 @@ declare const _default: (funcParams: funcParamsProps) => {
50
50
  };
51
51
  };
52
52
  };
53
+ RemoveItemButton: {
54
+ disabled: boolean;
55
+ };
53
56
  };
54
57
  required: string[];
55
58
  };
@@ -63,5 +66,7 @@ declare const _default: (funcParams: funcParamsProps) => {
63
66
  deleteEvent: () => void;
64
67
  deletePopUpComponent: () => void;
65
68
  deletePopUpEvent: () => void;
69
+ copyPasteElement: () => void;
70
+ RemoveItemButton: () => void;
66
71
  };
67
72
  export default _default;
@@ -5,6 +5,6 @@ export declare const getNavigationHistory: (config: any, path: string | undefine
5
5
  };
6
6
  export declare const saveFormdataInSessionStorage: (formData: any, path?: string) => any;
7
7
  export declare const getFormdataFromSessionStorage: (path?: string) => any;
8
- export declare function saveHandler(store: any, service: any, submitHandler: any, pageName?: string): Promise<void>;
8
+ export declare function saveHandler(store: any, service: any, submitHandler: any): Promise<void>;
9
9
  export declare const navigateHandler: (store: any, isSubmitted: any, pageName?: string | boolean) => void;
10
10
  export declare function okHandler(store: any): void;
package/package.json CHANGED
@@ -1,11 +1,15 @@
1
1
  {
2
2
  "name": "impaktapps-ui-builder",
3
- "version": "0.0.99",
3
+ "version": "0.0.101-alpha.1",
4
4
  "scripts": {
5
5
  "dev": "vite",
6
6
  "build": "tsc && vite build",
7
7
  "preview": "vite preview"
8
8
  },
9
+ "publishConfig": {
10
+ "tag": "alpha"
11
+ },
12
+
9
13
  "dependencies": {
10
14
  "@babel/core": "^7.16.12",
11
15
  "@insertcoinab/gwen-react-components": "^1.2.65",
@@ -11,6 +11,7 @@ const TextField = {
11
11
  "widget": "InputField"
12
12
  },
13
13
  config:{
14
+ layout: { xs: 12, sm: 6, md: 4, lg: 4 },
14
15
  main:{
15
16
  label:"Adhaar Card",
16
17
  formatStrArray:["9","9","9","9"," ","9","9","9","9"," ","X9","X9","X9","X9"],
@@ -42,6 +43,7 @@ const PanField = {
42
43
  "widget": "InputField"
43
44
  },
44
45
  config:{
46
+ layout: { xs: 12, sm: 6, md: 4, lg: 4 },
45
47
  main:{
46
48
  label:"Pan Card",
47
49
  placeholder:"AAAAA0000A",
@@ -5,16 +5,20 @@ import { createLayoutFormat } from "./buildConfig";
5
5
  export const buildCard = (config,componentScope,store) =>{
6
6
  const card: any = _.cloneDeep(Card(store.theme.myTheme));
7
7
  if (config.style) {
8
- card.config.style = JSON.parse(config.style)
8
+ card.config.wrapperStyle = JSON.parse(config.style)
9
9
  }
10
- card.elements[0].elements[0].elements[0].scope = `#/properties/${config.name}/properties/value`
10
+ card.elements[0].elements[0].elements[0].elements[1].scope = `#/properties/${config.name}/properties/value`
11
11
  card.elements[1].scope = `#/properties/${config.name}/properties/url`
12
12
  card.elements[0].elements[0].elements[1].scope = `#/properties/${config.name}/properties/description`
13
13
  if(config.layout){
14
14
  card.config.layout = createLayoutFormat(config.layout)
15
15
  }
16
+ if(config?.titleIcon){
17
+ card.elements[0].elements[0].elements[0].elements[0].config.main.heading = eval(`'\\${config.titleIcon}'`);
18
+ card.elements[0].elements[0].elements[0].elements[1].config.style.left = "24px"
19
+ }
16
20
  if(config.label){
17
- card.elements[0].elements[0].elements[0].config.main.heading = config.label;
21
+ card.elements[0].elements[0].elements[0].elements[1].config.main.heading = config.label;
18
22
  }
19
23
  if(config.url){
20
24
  card.elements[1].config.main.url = config.url;
@@ -35,14 +35,19 @@ export const createLayoutFormat = (config: any[]) => {
35
35
  lg: 12,
36
36
  }
37
37
  }
38
- let data: any = {};
38
+ let data: any = {
39
+ xs: 12,
40
+ sm: 12,
41
+ md: 6,
42
+ lg: 6,
43
+ };
39
44
  config.map((e: any) => {
40
45
  data[e.key || "xs"] = +e.value || 5.5
41
46
  })
42
47
  return data;
43
48
  };
44
49
  export const flatObjectValueInArray = (config: any[]=[]) => {
45
- if (config[0].length < 1) {
50
+ if (config.length < 1) {
46
51
  return
47
52
  }
48
53
  const keyName = Object.keys(config[0])[0]
@@ -1,4 +1,4 @@
1
- import { createLayoutFormat } from "./buildConfig";
1
+ import { createLayoutFormat, flatObjectValueInArray } from "./buildConfig";
2
2
  import { HorizontalBarGraph } from "./uischema/graph";
3
3
  import _ from "lodash";
4
4
 
@@ -18,34 +18,22 @@ const buildHorizontalBarGraph = (config:any,componentScope:string) => {
18
18
  if (config.bottomAxisAngle) {
19
19
  horizontalBarGraph.config.main.bottomAxisAngle = config.bottomAxisAngle==="YES"?true:false;
20
20
  }
21
- if (config.barColor) {
22
- horizontalBarGraph.config.barStyle.color = config.barColor;
21
+ if (config.legendLabels) {
22
+ horizontalBarGraph.config.main.legendLabels = flatObjectValueInArray(config.legendLabels);
23
+ }
24
+ if (config.pieArcColors) {
25
+ horizontalBarGraph.config.style.barStyle.colorRange = flatObjectValueInArray(config.pieArcColors);
23
26
  }
24
27
  if (config.xAxisValue) {
25
28
  horizontalBarGraph.config.main.xAxisValue = config.xAxisValue;
26
29
  }
27
- if (config.containerBackground) {
28
- horizontalBarGraph.config.containerStyle.background =
29
- config.containerBackground;
30
- }
31
30
  if (config.height) {
32
- horizontalBarGraph.config.style =
33
- {
34
- containerStyle: {
35
- height: config.height
36
- }
37
- }
38
-
31
+ horizontalBarGraph.config.style.containerStyle.height = config.height;
39
32
  }
40
33
  if (config.leftMargin) {
41
- horizontalBarGraph.config.style =
42
- {
43
- labelStyle: {
44
- margin: {
34
+ horizontalBarGraph.config.style.labelStyle.margin ={
45
35
  left: config.leftMargin
46
36
  }
47
- }
48
- }
49
37
  }
50
38
  if (config.bottomLabel) {
51
39
  horizontalBarGraph.config.main.bottomLabel =
@@ -57,4 +45,4 @@ const buildHorizontalBarGraph = (config:any,componentScope:string) => {
57
45
  return horizontalBarGraph
58
46
  }
59
47
 
60
- export default buildHorizontalBarGraph
48
+ export default buildHorizontalBarGraph;
@@ -9,7 +9,7 @@ const InputSlider = {
9
9
  },
10
10
 
11
11
  config: {
12
- layout: 12,
12
+ layout: { xs: 12, sm: 12, md: 6, lg: 6 },
13
13
  main: {
14
14
  limitToMax: false,
15
15
  max: 10000,
@@ -3,7 +3,6 @@ import buildUiSchema from "./buildUiSchema";
3
3
  import _ from "lodash";
4
4
  import { createLayoutFormat } from "./buildConfig";
5
5
 
6
-
7
6
  export const buildLeaderBoard = (config) => {
8
7
  const LeaderBoard: any = _.cloneDeep(leaderBoard)
9
8
  if (config.elements) {
@@ -14,29 +13,35 @@ export const buildLeaderBoard = (config) => {
14
13
  const widgetSchema = { widget: buildUiSchema(e), accessorKey: e.name, header: e.label || e.name, };
15
14
  return { ...widgetSchema };
16
15
  })
17
- LeaderBoard.elements[9].elements = modifyColumns;
16
+ LeaderBoard.elements = modifyColumns;
18
17
  }
19
18
  LeaderBoard.config.main.label = config.label
20
19
  if (config.name) {
21
- LeaderBoard.elements[0].scope = `#/properties/${config.name}/properties/firstImage`;
22
- LeaderBoard.elements[3].scope = `#/properties/${config.name}/properties/firstName`
23
- LeaderBoard.elements[1].scope = `#/properties/${config.name}/properties/secondImage`;
24
- LeaderBoard.elements[4].scope = `#/properties/${config.name}/properties/secondName`
25
- LeaderBoard.elements[2].scope = `#/properties/${config.name}/properties/thirdImage`;
26
- LeaderBoard.elements[5].scope = `#/properties/${config.name}/properties/thirdName`
27
- LeaderBoard.elements[9].scope = `#/properties/${config.name}/properties/table`
20
+ LeaderBoard.scope=`#/properties/${config.name}`
28
21
  }
29
22
  if (config.firstImage) {
30
- LeaderBoard.elements[0].config.main.url = config.firstImage;
23
+ LeaderBoard.config.main.firstImage = config.firstImage;
31
24
  }
32
25
  if (config.secondImage) {
33
- LeaderBoard.elements[1].config.main.url = config.secondImage;
26
+ LeaderBoard.config.main.secondImage = config.secondImage;
34
27
  }
35
- if (config.secondImage) {
36
- LeaderBoard.elements[2].config.main.url = config.thirdImage;
28
+ if (config.thirdImage) {
29
+ LeaderBoard.config.main.thirdImage = config.thirdImage;
30
+ }
31
+ if (config.nameKey) {
32
+ LeaderBoard.config.main.nameKey = config.nameKey;
33
+ }
34
+ if (config.imageKey) {
35
+ LeaderBoard.config.main.imageKey = config.imageKey;
36
+ }
37
+ if (config.scoreKey) {
38
+ LeaderBoard.config.main.scoreKey = config.scoreKey;
37
39
  }
38
40
  if (config.layout) {
39
41
  LeaderBoard.config.layout = createLayoutFormat(config.layout);
40
42
  }
43
+ if (config.style) {
44
+ LeaderBoard.config.style = JSON.parse(config.style)
45
+ }
41
46
  return LeaderBoard
42
47
  }
@@ -12,14 +12,9 @@ export const buildLineGraph = (config, componentScope) => {
12
12
  lineGraph.config.style.containerStyle.height = config.height;
13
13
  }
14
14
  if (config.leftMargin) {
15
- lineGraph.config.style =
16
- {
17
- labelStyle: {
18
- margin: {
15
+ lineGraph.config.style.labelStyle.margin ={
19
16
  left: config.leftMargin
20
17
  }
21
- }
22
- }
23
18
  }
24
19
  if (config.bottomLabel) {
25
20
  lineGraph.config.main.bottomLabel = config.bottomLabel;
@@ -34,13 +29,13 @@ export const buildLineGraph = (config, componentScope) => {
34
29
  lineGraph.config.main.leftLabel = config.leftLabel;
35
30
  }
36
31
  if (config.legendHide) {
37
- lineGraph.config.main.legendAvailabe = config.legendHide==="YES"?false:true;
32
+ lineGraph.config.main.legendAvailable = config.legendHide==="YES"?false:true;
38
33
  }
39
34
  if (config.bottomAxisAngle) {
40
35
  lineGraph.config.main.bottomAxisAngle = config.bottomAxisAngle==="YES"?true:false;
41
36
  }
42
37
  if (config.legendLabels) {
43
- lineGraph.config.main.tooltipDataKey = flatObjectValueInArray(config.legendLabels);
38
+ lineGraph.config.main.legendLabels = flatObjectValueInArray(config.legendLabels);
44
39
  }
45
40
 
46
41
  if (config.pieArcColors) {
@@ -0,0 +1,22 @@
1
+ import pdfViewer from "./uischema/pdfViewer";
2
+ import buildUiSchema from "./buildUiSchema";
3
+ import _ from "lodash";
4
+ import { createLayoutFormat } from "./buildConfig";
5
+
6
+ export const buildPdfViewer = (config) => {
7
+ const PdfViewer: any = _.cloneDeep(pdfViewer)
8
+ PdfViewer.config.main.label = config.label
9
+ if (config.name) {
10
+ PdfViewer.scope=`#/properties/${config.name}`
11
+ }
12
+ if (config.layout) {
13
+ PdfViewer.config.layout = createLayoutFormat(config.layout);
14
+ }
15
+ if(config.label) {
16
+ PdfViewer.config.main.title = config.label
17
+ }
18
+ if (config.style) {
19
+ PdfViewer.config.style = JSON.parse(config.style)
20
+ }
21
+ return PdfViewer
22
+ }
@@ -7,33 +7,22 @@ export const buildPieGraph = (config, componentScope) => {
7
7
  pieGraph.config.layout = createLayoutFormat(config.layout);
8
8
  }
9
9
  if (config.height) {
10
- pieGraph.config.style =
11
- {
12
- containerStyle: {
13
- height: config.height
14
- }
15
- };
16
-
10
+ pieGraph.config.style.containerStyle.height = config.height;
17
11
  }
18
12
  if (config.legendHide) {
19
- pieGraph.config.main.legendAvailabe = config.legendHide === "YES" ? false : true;
13
+ pieGraph.config.main.legendAvailable = config.legendHide === "YES" ? false : true;
20
14
  }
21
15
  pieGraph.scope = componentScope;
22
16
  pieGraph.config.main.header = config.heading;
23
17
 
24
18
  if (config.legendLabels) {
25
- pieGraph.config.main.tooltipDataKey = flatObjectValueInArray(config.legendLabels);
19
+ pieGraph.config.main.legendLabels = flatObjectValueInArray(config.legendLabels);
26
20
  }
27
21
  if (config.xAxisValue) {
28
22
  pieGraph.config.main.xAxisValue = config.xAxisValue;
29
23
  }
30
24
  if (config.pieArcColors) {
31
- pieGraph.config.style = {
32
- pieStyle: {
33
- colorRange: flatObjectValueInArray(config.pieArcColors)
34
- }
35
- }
36
-
25
+ pieGraph.config.style.pieStyle.colorRange = flatObjectValueInArray(config.pieArcColors);
37
26
  }
38
27
  return pieGraph;
39
28
  }
@@ -6,17 +6,11 @@ export const buildRankCard = (config,componentScope) =>{
6
6
  const rankCard: any = _.cloneDeep(RankCard);
7
7
  rankCard.scope = componentScope;
8
8
 
9
- if(config.image){
10
- rankCard.config.main.url = config.image;
11
- }
12
- if(config.title){
13
- rankCard.config.main.title = config.title
14
- }
15
- if(config.description){
16
- rankCard.config.main.description = config.description
17
- }
18
9
  if(config.rank){
19
- rankCard.config.main.rank = `#${config.rank}`
10
+ rankCard.config.main.rank = `${config.rank}`
11
+ }
12
+ if(config.height){
13
+ rankCard.config.main.height = `${config.height}px`
20
14
  }
21
15
  if(config.layout){
22
16
  rankCard.config.layout = createLayoutFormat(config.layout)
@@ -1,4 +1,4 @@
1
- import { createLayoutFormat } from "./buildConfig";
1
+ import { createLayoutFormat, flatObjectValueInArray } from "./buildConfig";
2
2
  import { BarGraph } from "./uischema/graph";
3
3
  import _ from "lodash";
4
4
 
@@ -14,10 +14,13 @@ export const buildStackbarGraph = (config:any,componentScope:string) => {
14
14
  if (config.bottomAxisAngle) {
15
15
  barGraph.config.main.bottomAxisAngle = config.bottomAxisAngle==="YES"?true:false;
16
16
  }
17
- barGraph.config.main.type = config.graphType;
17
+ barGraph.config.main.type = config?.graphType ?? "BarGraph";
18
18
  barGraph.config.main.header = config.heading;
19
- if (config.barColor) {
20
- barGraph.config.barStyle.color = config.barColor;
19
+ if (config.legendLabels) {
20
+ barGraph.config.main.legendLabels = flatObjectValueInArray(config.legendLabels);
21
+ }
22
+ if (config.pieArcColors) {
23
+ barGraph.config.style.barStyle.colorRange = flatObjectValueInArray(config.pieArcColors);
21
24
  }
22
25
  if (config.xAxisValue) {
23
26
  barGraph.config.main.xAxisValue = config.xAxisValue;
@@ -26,14 +29,9 @@ export const buildStackbarGraph = (config:any,componentScope:string) => {
26
29
  barGraph.config.style.containerStyle.height = config.height;
27
30
  }
28
31
  if (config.leftMargin) {
29
- barGraph.config.style =
30
- {
31
- labelStyle: {
32
- margin: {
32
+ barGraph.config.style.labelStyle.margin ={
33
33
  left: config.leftMargin
34
34
  }
35
- }
36
- }
37
35
  }
38
36
  if (config.bottomLabel) {
39
37
  barGraph.config.main.bottomLabel = config.bottomLabel;
@@ -0,0 +1,22 @@
1
+ import Thought from "./uischema/thoughtOfTheDay";
2
+ import _ from "lodash";
3
+ import { createLayoutFormat } from "./buildConfig";
4
+
5
+ export const buildThoughtOfTheDay = (config,componentScope) =>{
6
+ const thought: any = _.cloneDeep(Thought);
7
+ thought.scope = componentScope;
8
+
9
+ if(config.thought){
10
+ thought.config.main.thought = `${config.thought}`
11
+ }
12
+ if(config.layout){
13
+ thought.config.layout = createLayoutFormat(config.layout)
14
+ }
15
+ if(config.label){
16
+ thought.config.main.label = config.label;
17
+ }
18
+ if (config.style) {
19
+ thought.config.style = JSON.parse(config.style)
20
+ }
21
+ return thought;
22
+ }
@@ -39,6 +39,8 @@ import { buildPopUp } from "./buildPop";
39
39
  import { buildDataGrid } from "./buildDataGrid";
40
40
  import { buildInputSlider } from "./buildInputSlider";
41
41
  import { buildTreeMap } from "./buildTreeMap";
42
+ import { buildThoughtOfTheDay } from "./buildThoughtOfTheDay";
43
+ import { buildPdfViewer } from "./buildPdfViewer";
42
44
  export let schema = {
43
45
  type: "object",
44
46
  properties: {},
@@ -264,6 +266,9 @@ const buildUiSchema = (config: any, store?: any) => {
264
266
  case "HorizontalStackBarGraph":
265
267
  elements = buildHorizontalBarGraph(config, componentScope);
266
268
  break;
269
+ default:
270
+ elements = buildStackbarGraph(config, componentScope);
271
+ break;
267
272
  }
268
273
  break;
269
274
  case "ProgressBar":
@@ -300,6 +305,12 @@ const buildUiSchema = (config: any, store?: any) => {
300
305
  case "LeaderBoard":
301
306
  elements = buildLeaderBoard(config);
302
307
  break;
308
+ case "Thought":
309
+ elements = buildThoughtOfTheDay(config, componentScope);
310
+ break;
311
+ case "PdfViewer":
312
+ elements = buildPdfViewer(config);
313
+ break;
303
314
  default:
304
315
  schema = {
305
316
  type: "object",